.daily-shift-report { min-width: 0; }
.shift-report-header { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px; }
.daily-shift-report input, .daily-shift-report textarea { --tw-border-opacity: 1; border-color: rgb(221 210 193 / var(--tw-border-opacity, 1)); --tw-bg-opacity: 1; background-color: rgb(242 237 227 / var(--tw-bg-opacity, 1)); --tw-text-opacity: 1; color: rgb(48 42 42 / var(--tw-text-opacity, 1)); display: block; margin-top: 6px; width: 100%; min-width: 0; min-height: 44px; padding: 10px 12px; font-size: 16px; border-width: 1px; border-radius: 12px; }
.daily-shift-report textarea { min-height: 80px; resize: vertical; }
.daily-shift-report button { --tw-border-opacity: 1; border-color: rgb(221 210 193 / var(--tw-border-opacity, 1)); display: inline-flex; justify-content: center; align-items: center; gap: 8px; min-height: 44px; padding: 8px 14px; border-width: 1px; border-radius: 12px; font-size: 14px; font-weight: 600; }
.daily-shift-report button:disabled { opacity: .5; }
.daily-shift-report :is(input, textarea, button):focus-visible { outline-color: #ba9b4f; outline-style: solid; outline-width: 2px; outline-offset: 2px; }
.shift-report-fields, .shift-report-metrics, .shift-report-categories { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.shift-report-categories { column-gap: 32px; }
@media (min-width: 1000px) { .shift-report-metrics, .shift-report-fields { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@media (max-width: 480px) { .shift-report-fields, .shift-report-categories { grid-template-columns: minmax(0, 1fr); } .shift-report-metrics dd { font-size: 18px; overflow-wrap: anywhere; } .shift-report-header > label { width: 100%; } }

/* One shared report, sized by its actual workspace rather than the viewport. */
.automatic-shift-report { container-type: inline-size; }
.automatic-shift-summary { border: 1px solid; --tw-border-opacity: 1; border-color: rgb(221 210 193 / var(--tw-border-opacity, 1)); border-radius: 16px; overflow: hidden; }
.automatic-shift-columns { display: none; }
.automatic-shift-row { display: grid; grid-template-columns: minmax(0, 1fr) 44px; align-items: center; gap: 12px; padding: 12px 16px; }
.automatic-shift-row + .automatic-shift-row { border-top: 1px solid; --tw-border-opacity: 1; border-color: rgb(221 210 193 / var(--tw-border-opacity, 1)); }
.automatic-shift-name { min-width: 0; font-size: 16px; }
.automatic-shift-metrics { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 16px; }
.automatic-shift-metrics > div { min-width: 0; }
.automatic-shift-metrics dt { font-size: 16px; }
.automatic-shift-metrics dd { margin-top: 2px; font-size: 18px; overflow-wrap: anywhere; }
.daily-shift-report .automatic-shift-copy { grid-column: 2; grid-row: 1; width: 44px; height: 44px; padding: 0; }
.automatic-shift-empty { grid-column: 1 / -1; font-size: 16px; }
.automatic-shift-details { margin-top: 8px; }
.automatic-shift-details summary { width: fit-content; min-height: 44px; padding: 10px 4px; font-size: 16px; cursor: pointer; }
.automatic-shift-details summary:focus-visible { outline-color: #ba9b4f; outline: 2px solid; outline-offset: 2px; border-radius: 4px; }
.automatic-shift-detail-grid { display: grid; gap: 20px; padding-top: 8px; }
.automatic-shift-categories { display: grid; gap: 10px; margin-top: 12px; font-size: 16px; }
.automatic-shift-categories > div { display: flex; justify-content: space-between; gap: 16px; }
@container (min-width: 500px) {
  .automatic-shift-metrics { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .automatic-shift-detail-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@container (min-width: 800px) {
  .automatic-shift-columns, .automatic-shift-row { display: grid; grid-template-columns: minmax(160px, 1.25fr) repeat(5, minmax(0, 1fr)) 44px; gap: 16px; }
  .automatic-shift-columns { --tw-bg-opacity: 1; background-color: rgb(242 237 227 / var(--tw-bg-opacity, 1)); padding: 10px 16px; font-size: 16px; }
  .automatic-shift-metrics { display: contents; }
  .automatic-shift-metrics dt { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; }
  .automatic-shift-metrics dd { margin: 0; }
  .daily-shift-report .automatic-shift-copy { grid-column: 7; }
  .automatic-shift-empty { grid-column: 2 / -1; }
}

/* Owner-only density: retain all controls, labels and existing state handlers. */
.operations-content-container:has(#owner-dashboard-scope-title) > header {
  display: none;
}

#operations-main:has(#owner-dashboard-scope-title) {
  padding-top: 1rem;
}

#operations-main > div:has(> section[aria-labelledby='owner-dashboard-scope-title']) {
  container: owner-dashboard / inline-size;
}

#operations-main:has(#owner-dashboard-scope-title) section[aria-labelledby='management-dashboard-title'] {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: .75rem;
  padding: 1rem;
  border-radius: .75rem;
  box-shadow: none;
}

#operations-main:has(#owner-dashboard-scope-title) #management-dashboard-title {
  margin-top: 0;
  font-size: 1.5rem;
  line-height: 1.25;
}

#operations-main:has(#owner-dashboard-scope-title) section[aria-labelledby='management-dashboard-title'] p {
  display: none;
}

#operations-main:has(#owner-dashboard-scope-title) section[aria-labelledby='management-dashboard-title'] time {
  font-size: 1.25rem;
  line-height: 1.25;
}

#operations-main:has(#owner-dashboard-scope-title) section[aria-labelledby='management-dashboard-title'] > div:last-child > span {
  font-size: .875rem;
  letter-spacing: normal;
  text-transform: none;
}

#operations-main:has(#owner-dashboard-scope-title) section[aria-labelledby='owner-dashboard-scope-title'],
#operations-main:has(#owner-dashboard-scope-title) section[aria-labelledby='owner-dashboard-scope-title'] + form {
  margin-top: .75rem;
}

#operations-main:has(#owner-dashboard-scope-title) section[aria-labelledby='owner-dashboard-scope-title'] > div:first-child {
  display: none;
}

#operations-main:has(#owner-dashboard-scope-title) [aria-label='Контекст дашборда собственника'] {
  min-width: 0;
  gap: .5rem;
}

#operations-main:has(#owner-dashboard-scope-title) [aria-label='Контекст дашборда собственника'] button {
  min-width: 0;
  min-height: 3.75rem;
  padding: .5rem .25rem;
  border-radius: .75rem;
  box-shadow: none;
}

#operations-main:has(#owner-dashboard-scope-title) [aria-label='Контекст дашборда собственника'] button > span {
  overflow-wrap: normal;
}

#operations-main:has(#owner-dashboard-scope-title) [aria-label='Контекст дашборда собственника'] button > span:last-child {
  margin-top: .125rem;
  line-height: 1.25;
}

#operations-main:has(#owner-dashboard-scope-title) fieldset[aria-label='Фильтры дашборда'] {
  padding: .75rem 1rem;
  border-radius: .75rem;
  box-shadow: none;
}

#operations-main:has(#owner-dashboard-scope-title) fieldset[aria-label='Фильтры дашборда'] > div:first-of-type {
  margin-bottom: 0;
  font-size: 1rem;
}

#operations-main:has(#owner-dashboard-scope-title) #dashboard-filter-fields {
  margin-top: .75rem;
  gap: .75rem;
}

#operations-main:has(#owner-dashboard-scope-title) #dashboard-filter-fields .ops-control {
  min-width: 0;
  min-height: 2.75rem;
  font-size: 1rem;
}

@container owner-dashboard (min-width: 36rem) {
  #operations-main:has(#owner-dashboard-scope-title) [aria-label='Контекст дашборда собственника'] button {
    padding-inline: .75rem;
  }

  #operations-main:has(#owner-dashboard-scope-title) #management-dashboard-title {
    font-size: 1.75rem;
  }

  #operations-main:has(#owner-dashboard-scope-title) section[aria-labelledby='management-dashboard-title'] time {
    font-size: 1.5rem;
  }

  #operations-main:has(#owner-dashboard-scope-title) #dashboard-filter-fields {
    grid-template-columns: minmax(0, 1.25fr) repeat(2, minmax(0, 1fr));
  }

  #operations-main:has(#owner-dashboard-scope-title) #dashboard-filter-fields > label:last-of-type {
    grid-column: span 2;
  }

  #operations-main:has(#owner-dashboard-scope-title) #dashboard-filter-fields > div:last-child {
    grid-column: auto;
    align-items: end;
  }
}

@container owner-dashboard (max-width: 20rem) {
  #operations-main:has(#owner-dashboard-scope-title) [aria-label='Контекст дашборда собственника'] {
    grid-template-columns: minmax(0, 1fr);
  }

  #operations-main:has(#owner-dashboard-scope-title) [aria-label='Контекст дашборда собственника'] button {
    display: grid;
    grid-template-columns: 5rem minmax(0, 1fr);
    align-items: center;
    gap: .5rem;
    min-height: 2.75rem;
    padding-inline: .75rem;
  }
}

@container owner-dashboard (min-width: 52rem) {
  #operations-main:has(#owner-dashboard-scope-title) #dashboard-filter-fields {
    grid-template-columns: minmax(0, 1.5fr) repeat(2, minmax(0, 1fr)) minmax(0, 1.25fr) auto;
    align-items: end;
  }

  #operations-main:has(#owner-dashboard-scope-title) #dashboard-filter-fields > label:last-of-type {
    grid-column: auto;
  }
}

@container owner-dashboard (max-width: 23rem) {
  #operations-main:has(#owner-dashboard-scope-title) section[aria-labelledby='management-dashboard-title'] {
    grid-template-columns: minmax(0, 1fr);
    gap: .5rem;
  }

  #operations-main:has(#owner-dashboard-scope-title) section[aria-labelledby='management-dashboard-title'] > div:last-child {
    display: flex;
    align-items: baseline;
    gap: .5rem;
  }

  #operations-main:has(#owner-dashboard-scope-title) section[aria-labelledby='management-dashboard-title'] time {
    margin-top: 0;
  }
}

/* Keep the dashboard directly below the shared navigation on narrow screens. */
#operations-main:has(#owner-dashboard-scope-title) { padding-top: .5rem; }
#operations-main > div:has(> section[aria-labelledby='owner-dashboard-scope-title']) > * + * { margin-top: .75rem; }
#operations-main:has(#owner-dashboard-scope-title) .automatic-shift-report { padding: 1rem; border-radius: .75rem; }
#operations-main:has(#owner-dashboard-scope-title) .shift-report-header { gap: .5rem; }
#operations-main:has(#owner-dashboard-scope-title) #shift-report-title { font-size: 1.125rem; line-height: 1.4; }
#operations-main:has(#owner-dashboard-scope-title) .automatic-shift-summary { margin-top: .75rem; }
#operations-main:has(#owner-dashboard-scope-title) fieldset[aria-label='Фильтры дашборда'] button { min-height: 2.75rem; }
#operations-main:has(#owner-dashboard-scope-title) fieldset[aria-label='Фильтры дашборда'] .truncate { white-space: normal; }

@container (min-width: 800px) {
 .automatic-shift-columns, .automatic-shift-row { grid-template-columns: minmax(160px,1.25fr) repeat(5,minmax(0,1fr)) 44px; }
 .daily-shift-report .automatic-shift-copy { grid-column: 7; }
}
