:root {
  color-scheme: light;
  font-family: "X5 Sans UI", Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: #24262a;
  background: #eceef0;
  font-synthesis: none;
  --brand-green-950: #1f513d;
  --brand-green-800: #2f7658;
  --inspection-accepted-background: rgba(132, 211, 154, 0.2);
  --inspection-photo-accepted: #86ce9b;
  --brand-lime: #9ccfba;
  --brand-green-200: #b9ddcd;
  --brand-green-50: #eaf5ef;
  --brand-primary-950: #292b30;
  --brand-primary-800: #555960;
  --brand-primary-200: #cfd2d7;
  --brand-primary-50: #f0f1f3;
  --brand-blue: #767b83;
  --brand-blue-50: #f1f2f4;
  --brand-purple: #c8652a;
  --brand-purple-200: #e8b996;
  --brand-purple-50: #fbf1e9;
  --brand-pink: #d9824b;
  --brand-pink-50: #fcf4ed;
  --brand-coral: #d95c50;
  --brand-coral-50: #fcedea;
  --brand-orange: #c8652a;
  --brand-yellow: #ffc247;
  --surface: #ffffff;
  --surface-muted: #eceef0;
  --border: #d0d3d8;
  --text: #24262a;
  --text-muted: #555960;
  --font-weight-body: 400;
  --font-weight-label: 500;
  --font-weight-accent: 600;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  background: var(--surface-muted);
  font-weight: var(--font-weight-body);
}

/* Системные акценты не затрагивают форматирование пользовательских описаний. */
:where(strong, b):not(:where(.template-description-view *, .rich-text-editor *)) {
  font-weight: var(--font-weight-body);
}

h1, h2, h3, h4, h5, h6 {
  font-weight: var(--font-weight-accent);
}

/* Полноэкранная оболочка приложения */

body.application-open {
  overflow: hidden;
  background: var(--surface-muted);
}

.application-open .network-status {
  position: fixed;
  z-index: 10;
  top: 0;
  right: 0;
  left: 0;
}

.application-open .page-shell {
  min-height: 100dvh;
  padding: 0;
  place-items: stretch;
}

.auth-card.application-mode {
  position: relative;
  display: grid;
  grid-template-columns: 18rem minmax(0, 1fr);
  grid-template-rows: auto minmax(0, 1fr);
  width: 100%;
  max-width: none;
  height: 100dvh;
  padding: 0;
  overflow: hidden;
  background: var(--surface-muted);
  border: 0;
  border-radius: 0;
  box-shadow: none;
  transition: grid-template-columns 180ms ease;
}

.auth-card.application-mode.sidebar-collapsed {
  grid-template-columns: 5.25rem minmax(0, 1fr);
}

.app-sidebar {
  z-index: 4;
  display: flex;
  grid-column: 1;
  grid-row: 1 / -1;
  min-width: 0;
  padding: 0.85rem;
  overflow: hidden;
  color: #ffffff;
  background: var(--brand-green-950);
  border-right: 1px solid var(--brand-green-800);
  flex-direction: column;
}

.sidebar-brand,
.sidebar-nav__button {
  display: flex;
  width: 100%;
  min-height: 3.25rem;
  align-items: center;
  gap: 0.85rem;
  padding: 0.55rem;
  color: #e9ece9;
  text-align: left;
  background: transparent;
  border: 0;
  border-radius: 0.75rem;
  cursor: pointer;
  font: inherit;
  font-weight: var(--font-weight-body);
}

.sidebar-brand:hover,
.sidebar-nav__button:hover {
  color: #ffffff;
  background: var(--brand-green-800);
}

.sidebar-brand:focus-visible,
.sidebar-nav__button:focus-visible {
  outline: 0.2rem solid rgba(255, 255, 255, 0.65);
  outline-offset: 0.1rem;
}

.brand-mark {
  position: relative;
  display: grid;
  width: 2.55rem;
  height: 2.55rem;
  flex: 0 0 2.55rem;
  background: #ffffff;
  border-radius: 0.55rem;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.35);
  overflow: hidden;
  place-items: center;
}

.brand-mark img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.sidebar-brand__text {
  max-width: 10rem;
  color: #ffffff;
  font-size: 1rem;
  line-height: 1.2;
}

.sidebar-nav {
  display: grid;
  gap: 0.25rem;
  margin-top: 1.5rem;
}

.sidebar-nav__button svg {
  width: 1.5rem;
  height: 1.5rem;
  flex: 0 0 1.5rem;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.7;
}

.sidebar-nav__count {
  min-width: 1.65rem;
  margin-left: auto;
  padding: 0.15rem 0.42rem;
  color: #ffffff;
  background: #c8652a;
  border-radius: 999px;
  font-size: 0.75rem;
  font-variant-numeric: tabular-nums;
  font-weight: var(--font-weight-body);
  line-height: 1.2;
  text-align: center;
}

.sidebar-nav__count[hidden] {
  display: none;
}

.sidebar-nav__button[aria-current='page'] {
  color: var(--brand-green-950);
  background: var(--brand-lime);
  box-shadow: inset 0.2rem 0 var(--brand-green-50);
}

.sidebar-footer {
  display: grid;
  gap: 0.3rem;
  margin-top: auto;
  padding-top: 1rem;
  border-top: 1px solid rgba(234, 251, 220, 0.24);
}

.sidebar-user {
  display: flex;
  min-height: 3.5rem;
  align-items: center;
  gap: 0.75rem;
  padding: 0.45rem 0.55rem 0.8rem;
}

.sidebar-user__avatar {
  display: grid;
  width: 2.35rem;
  height: 2.35rem;
  flex: 0 0 2.35rem;
  color: var(--brand-green-950);
  background: var(--brand-green-50);
  border-radius: 50%;
  font-size: 0.75rem;
  font-weight: var(--font-weight-body);
  place-items: center;
}

.sidebar-user__details {
  display: grid;
  min-width: 0;
  gap: 0.08rem;
}

.sidebar-user__details strong,
.sidebar-user__details span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sidebar-user__details span {
  color: #adb3ae;
  font-size: 0.75rem;
}

.sidebar-nav__button--logout {
  color: #eafbdc;
}

.sidebar-collapsed .sidebar-label {
  display: none;
}

.sidebar-collapsed .sidebar-nav__button:has(.sidebar-nav__count:not([hidden])) {
  position: relative;
}

.sidebar-collapsed .sidebar-nav__count {
  position: absolute;
  top: 0.2rem;
  right: 0.1rem;
  min-width: 1.25rem;
  padding: 0.1rem 0.28rem;
  font-size: 0.65rem;
}

.sidebar-collapsed .sidebar-brand,
.sidebar-collapsed .sidebar-nav__button,
.sidebar-collapsed .sidebar-user {
  justify-content: center;
}

.workspace-header {
  z-index: 2;
  display: flex;
  grid-column: 2;
  grid-row: 1;
  min-width: 0;
  align-items: center;
  padding: 1rem clamp(1.25rem, 3vw, 2.5rem);
  background: rgba(255, 255, 255, 0.94);
  border-bottom: 1px solid #dedfdb;
  backdrop-filter: blur(0.6rem);
}

.workspace-header .eyebrow {
  margin-bottom: 0.3rem;
}

.workspace-header h1 {
  font-size: clamp(1.6rem, 3vw, 2.35rem);
}

.workspace-panel {
  position: relative;
  z-index: 1;
  grid-column: 2;
  grid-row: 2;
  min-width: 0;
  margin: 0;
  padding: clamp(1rem, 1.5vw, 1.5rem) clamp(1.25rem, 3vw, 2.5rem);
  overflow: auto;
}

.workspace-lead {
  max-width: 46rem;
  margin: 0.75rem 0 0;
  color: var(--text-muted);
  line-height: 1.6;
}

.empty-state {
  display: flex;
  max-width: 48rem;
  align-items: center;
  gap: 1rem;
  margin-top: 2rem;
  padding: 1.25rem;
  background: rgba(255, 255, 255, 0.84);
  border: 1px solid #dedfdb;
  border-radius: 1rem;
  box-shadow: 0 0.65rem 2rem rgba(26, 29, 27, 0.06);
}

.empty-state p {
  margin: 0.35rem 0 0;
  color: var(--text-muted);
  line-height: 1.5;
}

.empty-state__icon,
.empty-state__number {
  display: grid;
  width: 3.5rem;
  height: 3.5rem;
  flex: 0 0 3.5rem;
  color: #ffffff;
  background: #0f5a05;
  border-radius: 0.9rem;
  font-weight: var(--font-weight-body);
  place-items: center;
}

.empty-state__number {
  color: #003e14;
  background: #eafbdc;
}

.template-form {
  margin-top: 0;
  padding: clamp(1rem, 2.5vw, 1.5rem);
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid #dedfdb;
  border-radius: 1rem;
  box-shadow: 0 0.65rem 2rem rgba(26, 29, 27, 0.06);
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.description-field {
  margin-top: 1rem;
}

.attachment-list {
  display: grid;
  gap: 0.5rem;
  margin: 0.8rem 0 0;
  padding: 0;
  list-style: none;
}

.attachment-list__item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.65rem 0.75rem;
  border: 1px solid #d9e1d6;
  border-radius: 0.6rem;
  background: #ffffff;
}

.attachment-list__link {
  min-width: 0;
  color: #075f18;
  font-weight: var(--font-weight-accent);
  overflow-wrap: anywhere;
}

.attachment-list__meta {
  color: var(--text-muted);
  font-size: 0.85rem;
  white-space: nowrap;
}

.attachment-list__main {
  display: flex;
  min-width: 0;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.35rem 0.65rem;
}

@media (max-width: 640px) {
  .attachment-list__item {
    align-items: stretch;
    flex-direction: column;
  }
}

.description-field > .attachment-list {
  margin-top: 0;
  padding: 0.6rem;
  border: 1px solid #9eaa9d;
  border-top: 0;
  border-radius: 0 0 0.65rem 0.65rem;
  background: #f8faf8;
}

.description-field > .panel-status:not([hidden]) {
  margin: 0;
  padding: 0.55rem 0.75rem;
  border-right: 1px solid #9eaa9d;
  border-left: 1px solid #9eaa9d;
  background: #f8faf8;
}

.description-field:has(.attachment-list:not([hidden])) .rich-text-editor,
.description-field:has(.panel-status:not([hidden])) .rich-text-editor {
  border-radius: 0;
}

.combobox-field {
  position: relative;
}

.combobox-options {
  position: absolute;
  z-index: 20;
  top: 100%;
  right: 0;
  left: 0;
  max-height: 16rem;
  margin: 0.3rem 0 0;
  padding: 0.35rem;
  overflow-y: auto;
  list-style: none;
  border: 1px solid #9eaa9d;
  border-radius: 0.65rem;
  background: #ffffff;
  box-shadow: 0 0.75rem 1.75rem rgba(26, 29, 27, 0.16);
}

.combobox-options button {
  width: 100%;
  padding: 0.7rem 0.8rem;
  color: #172019;
  background: transparent;
  border: 0;
  border-radius: 0.45rem;
  text-align: left;
  font: inherit;
  font-weight: var(--font-weight-body);
  cursor: pointer;
}

.combobox-options button:hover,
.combobox-options button:focus-visible,
.combobox-options button[aria-selected='true'] {
  color: #003e14;
  background: #eafbdc;
  outline: none;
}

.rich-text-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  padding: 0.5rem;
  border: 1px solid #c9d1c8;
  border-bottom: 0;
  border-radius: 0.65rem 0.65rem 0 0;
  background: #f2f4f1;
}

.rich-text-toolbar button,
.rich-text-toolbar select {
  min-height: 2.25rem;
  padding: 0.4rem 0.65rem;
  color: #172019;
  background: #ffffff;
  border: 1px solid #bfc8be;
  border-radius: 0.45rem;
  font: inherit;
}

.rich-text-toolbar button {
  min-width: 2.35rem;
  cursor: pointer;
}

.rich-text-toolbar__icon-button svg {
  display: block;
  width: 1.2rem;
  height: 1.2rem;
  margin: auto;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.rich-text-toolbar button:hover,
.rich-text-toolbar button:focus-visible,
.rich-text-toolbar select:focus-visible {
  border-color: #0f6b22;
  outline: 2px solid rgba(15, 107, 34, 0.18);
  outline-offset: 1px;
}

.rich-text-editor {
  min-height: 8rem;
  max-height: 22rem;
  overflow-y: auto;
  padding: 0.8rem;
  color: #172019;
  background: #ffffff;
  border: 1px solid #9eaa9d;
  border-radius: 0 0 0.65rem 0.65rem;
  line-height: 1.55;
}

.rich-text-editor:focus {
  border-color: #0f6b22;
  outline: 2px solid rgba(15, 107, 34, 0.18);
  outline-offset: 1px;
}

.rich-text-editor:empty::before {
  color: var(--text-muted);
  content: attr(data-placeholder);
  pointer-events: none;
}

.rich-text-editor p,
.rich-text-editor ul {
  margin: 0 0 0.6rem;
}

.description-text--small {
  font-size: 0.86em;
}

.description-text--normal {
  font-size: 1em;
}

.description-text--large {
  font-size: 1.25em;
}

.description-highlight--red {
  background: #f6caca;
}

.description-highlight--green {
  background: #dff3d2;
}

.description-highlight--gray {
  background: #e2e4e1;
}

.template-description-view {
  color: #344158;
  line-height: 1.55;
}

.template-description-view p,
.template-description-view ul {
  margin: 0.4rem 0 0.8rem;
}

.form-section-header,
.template-items-heading,
.template-item__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
}

.template-items-heading {
  margin-top: 1.5rem;
}

.template-items-heading p {
  margin: 0.4rem 0 0;
  color: var(--text-muted);
  line-height: 1.5;
}

.template-items {
  display: grid;
  gap: 1rem;
  margin-top: 1rem;
}

.template-item {
  min-width: 0;
  margin: 0;
  padding: 1rem;
  background: #f8faf8;
  border: 1px solid #dde3dc;
  border-radius: 0.8rem;
}

.template-item__title {
  margin: 0;
  font-size: 1rem;
  font-weight: var(--font-weight-accent);
}

.template-requirements {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.65rem;
  margin-top: 1rem;
}

.option-field {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  min-height: 2.75rem;
  padding: 0.65rem 0.75rem;
  color: #344158;
  background: #ffffff;
  border: 1px solid #d8ded7;
  border-radius: 0.6rem;
  font-weight: var(--font-weight-label);
}

.option-field input {
  width: 1.1rem;
  height: 1.1rem;
  accent-color: #0f5a05;
}

.form-grid--template-main .field:last-child {
  grid-column: auto;
}

.template-columns {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.25rem;
  margin-top: 0;
}

.template-column {
  min-width: 0;
  padding: clamp(1rem, 2vw, 1.35rem);
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid #dedfdb;
  border-radius: 1rem;
  box-shadow: 0 0.65rem 2rem rgba(26, 29, 27, 0.06);
}

.template-column__header,
.template-card__heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
}

.template-column__actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.6rem;
}

.template-column__actions .button {
  margin-top: 0;
}

.template-column .search-field {
  margin-top: 1.25rem;
}

.template-column .panel-status {
  margin-top: 1rem;
}

.assignment-store-list {
  display: grid;
  height: clamp(12rem, 28vh, 18rem);
  align-content: start;
  gap: 0.5rem;
  margin-top: 0.75rem;
  padding: 0.7rem;
  overflow-y: auto;
  overscroll-behavior: contain;
  background: var(--surface-muted);
  border: 1px solid var(--border);
  border-radius: 0.75rem;
  scrollbar-color: var(--brand-green-200) transparent;
}

.assignment-store-selection {
  display: grid;
  grid-template-columns: max-content minmax(0, 1fr);
  align-items: start;
  gap: 1rem;
  margin-top: 0.85rem;
}

.assignment-selected-stores {
  min-width: 0;
}

.assignment-selected-stores strong {
  display: block;
  margin-bottom: 0.4rem;
  color: var(--text);
  font-size: 0.85rem;
}

.assignment-store-filter {
  min-width: 0;
}

.assignment-store-filter .overview-filter-multi__dropdown {
  top: 4.9rem;
}

.assignment-store-filter .panel-status {
  margin: 0.55rem 0 0;
}

.selected-store-chips {
  display: flex;
  max-height: 6.5rem;
  flex-wrap: wrap;
  gap: 0.4rem;
  overflow-y: auto;
}

.selected-store-chip {
  display: inline-flex;
  max-width: 100%;
  align-items: center;
  gap: 0.4rem;
  padding: 0.35rem 0.55rem;
  color: var(--brand-green-950);
  background: var(--brand-green-50);
  border: 1px solid var(--brand-green-200);
  border-radius: 999px;
  cursor: pointer;
  font: inherit;
  font-size: 0.78rem;
  font-weight: var(--font-weight-accent);
}

.selected-store-chip:hover,
.selected-store-chip:focus-visible {
  background: var(--brand-green-200);
  outline: 2px solid rgba(92, 143, 214, 0.35);
  outline-offset: 1px;
}

.selected-store-chip span {
  font-size: 1rem;
  line-height: 1;
}

.selected-store-chips__empty {
  color: var(--text-muted);
  font-size: 0.85rem;
}

.assignment-recurring-fields {
  margin-top: 1rem;
  padding-top: 0.25rem;
  border-top: 1px solid #dde3dc;
}

.template-column__header .eyebrow {
  margin-bottom: 0.35rem;
}

.count-badge {
  min-width: 2rem;
  padding: 0.3rem 0.65rem;
  color: #003e14;
  background: #eafbdc;
  border: 1px solid #c5eaae;
  border-radius: 999px;
  text-align: center;
  font-size: 0.85rem;
  font-weight: var(--font-weight-body);
}

.overview-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem;
}

.overview-heading h2 {
  margin: 0;
}

.overview-metrics {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.75rem;
}

.overview-list-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  margin-block: 16px;
}

.overview-bulk-actions,
.overview-export-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.overview-export-actions .panel-status {
  margin: 0;
}

.overview-bulk-cancel-button {
  display: inline-grid;
  width: 2.75rem;
  height: 2.75rem;
  padding: 0;
  place-items: center;
  color: #a53b32;
  background: #fff7f5;
  border: 1px solid #efb2ab;
  border-radius: 0.75rem;
  cursor: pointer;
  transition: color 140ms ease, background 140ms ease, border-color 140ms ease;
}

.overview-bulk-cancel-button svg {
  width: 1.25rem;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.overview-bulk-cancel-button:hover:not(:disabled) {
  color: #ffffff;
  background: #a53b32;
  border-color: #a53b32;
}

.overview-bulk-cancel-button:focus-visible {
  outline: 3px solid rgba(165, 59, 50, 0.22);
  outline-offset: 0.15rem;
}

.overview-bulk-cancel-button:disabled {
  cursor: not-allowed;
  opacity: 0.42;
}

.overview-selection-count {
  color: var(--text-muted);
  font-weight: var(--font-weight-body);
}

.overview-metric {
  display: grid;
  min-width: 7rem;
  gap: 0.2rem;
  padding: 0.75rem 1rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 0.8rem;
  color: inherit;
  font: inherit;
  text-align: left;
}

button.overview-metric {
  cursor: pointer;
}

button.overview-metric:hover {
  border-color: var(--brand-purple);
  box-shadow: 0 0.35rem 1rem rgba(255, 120, 0, 0.12);
}

button.overview-metric:focus-visible {
  outline: 3px solid rgba(255, 120, 0, 0.28);
  outline-offset: 2px;
}

.overview-metric--selected {
  background: var(--brand-purple-50);
  border-color: var(--brand-purple);
  box-shadow: inset 0 -3px 0 var(--brand-purple);
}

.overview-metric span {
  color: var(--text-muted);
  font-size: 0.8rem;
}

.overview-metric strong {
  color: var(--brand-green-950);
  font-size: 1.5rem;
}

.overview-metric--rate {
  min-width: 12rem;
}

.overview-filters {
  display: grid;
  grid-template-columns: repeat(2, minmax(9rem, 0.7fr)) minmax(11rem, 1fr) minmax(14rem, 1.5fr) minmax(12rem, 1fr);
  align-items: start;
  gap: 0.75rem;
  margin-top: 1rem;
}

.overview-filters > .field {
  margin-top: 0;
}

.overview-filter-multi {
  position: relative;
  min-inline-size: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

.overview-filter-multi legend {
  margin-bottom: 0.5rem;
  color: #344158;
  font-weight: var(--font-weight-label);
}

.overview-filter-multi__trigger {
  display: flex;
  width: 100%;
  min-height: 3rem;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.75rem 0.875rem;
  color: #172033;
  background: var(--surface);
  border: 1px solid #aeb9ca;
  border-radius: 0.625rem;
  font: inherit;
  font-weight: var(--font-weight-body);
  text-align: left;
  cursor: pointer;
}

.overview-filter-multi__trigger:hover {
  border-color: var(--brand-primary-800);
}

.overview-filter-multi__trigger:focus-visible {
  outline: 0.18rem solid rgba(200, 101, 42, 0.2);
  outline-offset: 0.1rem;
  border-color: var(--brand-orange);
}

.overview-filter-multi__chevron {
  width: 0.55rem;
  height: 0.55rem;
  flex: 0 0 auto;
  border-right: 0.12rem solid currentColor;
  border-bottom: 0.12rem solid currentColor;
  transform: translateY(-0.15rem) rotate(45deg);
  transition: transform 150ms ease;
}

.overview-filter-multi__trigger[aria-expanded='true'] .overview-filter-multi__chevron {
  transform: translateY(0.15rem) rotate(225deg);
}

.overview-filter-multi__dropdown {
  position: absolute;
  z-index: 30;
  top: calc(100% + 0.4rem);
  right: 0;
  left: 0;
  min-width: 15rem;
  padding: 0.65rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 0.75rem;
  box-shadow: var(--shadow);
}

.overview-filter-multi__search {
  width: 100%;
  min-height: 2.6rem;
  padding: 0.65rem 0.75rem;
  color: var(--text);
  background: var(--surface);
  border: 1px solid #aeb9ca;
  border-radius: 0.55rem;
  font: inherit;
}

.overview-filter-multi__dropdown > .button {
  min-height: 2.25rem;
  margin-top: 0.55rem;
  padding: 0.45rem 0.7rem;
}

.overview-filter-multi__options {
  position: static;
  height: min(16rem, 35vh);
  min-width: 0;
  margin-top: 0.55rem;
  box-shadow: none;
}

.overview-store-filter {
  position: relative;
  margin-top: 0.75rem;
  padding: 0;
}

.overview-store-filter .overview-filter-multi__dropdown {
  top: 4.9rem;
}

.overview-store-filter__modes {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.45rem;
}

.overview-store-filter__modes .button {
  width: 100%;
}

.overview-store-filter__modes .overview-store-mode--active {
  color: #fff;
  border-color: var(--brand-primary-800);
  background: var(--brand-primary-800);
}

.overview-store-filter__selected {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.65rem;
  margin-top: 0.65rem;
}

.overview-store-filter__selected strong {
  margin: 0;
  white-space: nowrap;
}

.overview-store-filter .selected-store-chips,
.operational-filter--stores .selected-store-chips {
  min-width: 0;
  max-height: 3.4rem;
  flex: 1 1 auto;
}

.operational-filter {
  min-width: 0;
}

.operational-filter--stores .overview-filter-multi__dropdown {
  top: 4.9rem;
}

.inspection-controls > .operational-filter {
  width: 100%;
}

.inspection-history-detail__summary {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-bottom: 1rem;
  color: var(--text-muted);
}

.inspection-history-detail__answer {
  margin-top: 0.8rem;
  padding: 0.75rem;
  background: var(--surface);
  border-radius: 0.6rem;
}

.inspection-history-detail__violation {
  background: var(--surface);
  border: 1px solid var(--border);
}

.inspection-ai-analysis {
  display: grid;
  gap: 0.55rem;
  margin-top: 0.9rem;
  padding: 0.85rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 0.7rem;
}

.inspection-ai-analysis--suspicious {
  background: var(--surface);
  border-color: var(--border);
}

.inspection-ai-analysis p,
.inspection-ai-analysis ul {
  margin: 0;
}

.inspection-ai-analysis__warning {
  color: var(--danger);
  font-weight: var(--font-weight-body);
}

.inspection-ai-analysis__meta {
  color: var(--text-muted);
  font-size: 0.9rem;
}

.inspection-ai-analysis__violations {
  display: grid;
  gap: 0.75rem;
  padding-left: 1.25rem;
}

.inspection-ai-analysis__violations li {
  display: grid;
  gap: 0.25rem;
}

.inspection-ai-analysis__recommendation {
  color: var(--text-muted);
}

.inspection-ai-analysis__select-result {
  display: inline-grid;
  width: 2rem;
  height: 2rem;
  margin-left: 0.4rem;
  padding: 0;
  place-items: center;
  color: var(--brand-purple);
  background: transparent;
  border: 0;
  border-radius: 0.5rem;
  cursor: pointer;
  vertical-align: middle;
}

.inspection-ai-analysis__select-result:hover {
  background: var(--brand-purple-50);
}

.inspection-ai-analysis__select-result:focus-visible {
  outline: 2px solid currentColor;
  outline-offset: 2px;
}

.inspection-ai-analysis__select-result svg {
  width: 1.5rem;
  height: 1.5rem;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.inspection-remediation-editor {
  display: grid;
  gap: 0.85rem;
  margin-top: 1rem;
  padding: 1rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 0.75rem;
}

.inspection-remediation-editor__status {
  margin: 1rem 0 0;
  color: var(--text-muted);
  font-weight: var(--font-weight-body);
}

.inspection-remediation-editor__status--success {
  color: var(--brand-green-800);
}

.inspection-remediation-editor__status--error {
  color: var(--danger);
}

.inspection-remediation-editor__comment-control {
  position: relative;
}

.inspection-remediation-editor .inspection-remediation-editor__comment-control textarea {
  width: 100%;
  padding-right: 3.8rem;
}

.inspection-remediation-editor__comment-save {
  position: absolute;
  top: 50%;
  right: 0.55rem;
  display: grid;
  width: 2.65rem;
  height: 2.65rem;
  padding: 0;
  color: #ffffff;
  background: var(--brand-primary-800);
  border: 0;
  border-radius: 50%;
  cursor: pointer;
  place-items: center;
  transform: translateY(-50%);
}

.inspection-remediation-editor__comment-save:hover {
  background: var(--brand-primary-950);
}

.inspection-remediation-editor__comment-save:focus-visible {
  outline: 0.2rem solid rgba(92, 143, 214, 0.32);
  outline-offset: 0.15rem;
}

.inspection-remediation-editor__comment-save:disabled {
  cursor: wait;
  opacity: 0.65;
}

.inspection-remediation-editor__comment-save svg {
  width: 1.35rem;
  height: 1.35rem;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

.inspection-remediation-materials {
  display: grid;
  gap: 0.75rem;
  margin-top: 0.9rem;
  padding: 0.9rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 0.7rem;
}

.inspection-remediation-materials__heading {
  display: flex;
  gap: 0.75rem;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
}

.inspection-remediation-photos__remove-list {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.inspection-remediation-photo-pairs {
  display: grid;
  gap: 1rem;
  margin-top: 1rem;
  padding: 1rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 0.85rem;
}

.inspection-remediation-photo-pairs__heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.inspection-remediation-photo-pair {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
  align-items: start;
}

.inspection-remediation-photo-pair__panel {
  display: grid;
  min-width: 0;
  gap: 0.75rem;
  padding: 0.8rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 0.75rem;
}

.inspection-remediation-photo-pair__panel--source .inspection-remediation-photo-pair__frame {
  border-color: var(--brand-coral);
}

.inspection-remediation-photo-pair__panel--correction {
  border-color: var(--border);
}

.inspection-remediation-photo-pair__panel--accepted {
  border-color: var(--border);
}

.inspection-remediation-photo-pair__panel--accepted .inspection-remediation-photo-pair__frame {
  border-color: var(--inspection-photo-accepted);
}

.inspection-remediation-photo-pair__frame {
  display: block;
  overflow: hidden;
  background: #151915;
  border: 5px solid transparent;
  border-radius: 0.65rem;
}

.inspection-remediation-photo-pair__frame img {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: contain;
}

.inspection-remediation-photo-pair__photo {
  position: relative;
}

.inspection-remediation-photo-pair__remove {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  display: grid;
  width: 2.25rem;
  height: 2.25rem;
  padding: 0;
  place-items: center;
  color: #fff;
  background: #822c20;
  border: 2px solid #fff;
  border-radius: 50%;
  font-size: 1.6rem;
  cursor: pointer;
}

.inspection-remediation-photo-pair__remove:focus-visible {
  outline: 3px solid var(--brand-green-800);
  outline-offset: 2px;
}

.inspection-remediation-photo-pair__remove:disabled {
  opacity: 0.65;
  cursor: wait;
}

.inspection-remediation-photo-pair__comment {
  color: var(--text);
}

.inspection-remediation-photo-pair__comment p {
  margin: 0.35rem 0 0;
  white-space: pre-wrap;
}

.inspection-remediation-photo-pair__correction-content {
  display: grid;
  gap: 0.75rem;
}

.inspection-remediation-photo-pair__placeholder {
  display: grid;
  min-height: min(34vw, 28rem);
  place-items: center;
  padding: 1rem;
  color: var(--text-muted);
  text-align: center;
  background: var(--surface-muted);
  border: 2px dashed var(--brand-green-200);
  border-radius: 0.65rem;
  font-weight: var(--font-weight-body);
}

.inspection-remediation-photo-pair__placeholder--accepted {
  color: var(--text-muted);
  background: var(--surface-muted);
  border-style: solid;
}

.inspection-remediation-photo-pair__director-comment {
  display: grid;
  gap: 0.55rem;
}

.inspection-remediation-photo-pair__director-comment textarea {
  min-height: 6.5rem;
  resize: vertical;
}

.inspection-remediation-photo-pair__director-comment .button {
  width: fit-content;
  margin: 0;
}

.inspection-remediation-photo-pair__comment-meta {
  color: var(--text-muted);
}

.inspection-remediation-photo-pair__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
}

.inspection-remediation-photo-pairs__accepted {
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}

@media (max-width: 52rem) {
  .inspection-remediation-photo-pair {
    grid-template-columns: 1fr;
  }

  .inspection-remediation-photo-pair__placeholder {
    min-height: 16rem;
  }
}

.inspection-history-detail__answer p {
  margin: 0.35rem 0;
  white-space: pre-wrap;
}

.inspection-history-detail__answer small,
.inspection-history-detail__acknowledgement {
  color: var(--text-muted);
}

.inspection-history-detail__acknowledgement {
  margin: 0.75rem 0 0;
  font-size: 0.9rem;
  font-weight: var(--font-weight-body);
}

.inspection-history-detail__materials-title {
  display: block;
  margin: 0.9rem 0 0.55rem;
}

.inspection-history-detail__materials {
  margin-bottom: 1rem;
}

.inspection-detail__item--review-accepted {
  background: var(--inspection-accepted-background);
  border-color: var(--border);
}

.inspection-detail__item--review-sent-to-supervisor {
  background: var(--surface);
  border-color: var(--border);
}

.inspection-detail__item--review-sent-back {
  background: var(--surface);
  border-color: var(--border);
}

.inspection-review-decision {
  display: grid;
  gap: 0.75rem;
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}

.inspection-review-decision__choices {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
}

.inspection-review-decision__choices label {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.65rem 0.8rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 0.65rem;
  cursor: pointer;
  font-weight: var(--font-weight-accent);
}

.inspection-review-decision__choices input,
.inspection-review-photo input {
  width: 1rem;
  height: 1rem;
  accent-color: var(--brand-green-800);
}

.inspection-review-decision__choices span,
.inspection-review-photo span {
  display: inline;
  margin: 0;
  color: inherit;
  font-size: inherit;
}

.inspection-review-decision__violation {
  display: grid;
  gap: 0.7rem;
  padding: 0.8rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 0.7rem;
}

.inspection-review-decision--sent-to-supervisor .inspection-review-decision__violation {
  background: var(--surface);
  border-color: var(--border);
}

.inspection-review-decision__violation textarea {
  width: 100%;
  min-height: 6rem;
  padding: 0.75rem;
  color: var(--text);
  background: var(--surface);
  border: 1px solid #aeb9ca;
  border-radius: 0.65rem;
  resize: vertical;
  font: inherit;
}

.inspection-review-decision__comment-hint {
  color: var(--text-muted);
  line-height: 1.4;
}

.inspection-review-decision__photos {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(7.5rem, 1fr));
  gap: 0.65rem;
}

.inspection-review-photo {
  position: relative;
  display: grid;
  gap: 0.35rem;
  padding: 0.45rem;
  background: var(--surface-muted);
  border: 1px solid var(--border);
  border-radius: 0.65rem;
  cursor: pointer;
}

.inspection-review-photo:has(input:checked) img {
  border-color: var(--brand-coral);
  box-shadow: 0 0 0 0.15rem rgba(225, 91, 70, 0.18);
}

.inspection-review-decision--sent-to-supervisor .inspection-review-photo:has(input:checked) img {
  border-color: var(--brand-coral);
  box-shadow: 0 0 0 0.15rem rgba(225, 91, 70, 0.18);
}

.inspection-review-photo--automatic {
  cursor: default;
}

.inspection-review-photo input {
  position: absolute;
  top: 0.75rem;
  left: 0.75rem;
  z-index: 1;
}

.inspection-review-photo img {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  background: #151915;
  border: 5px solid transparent;
  border-radius: 0.45rem;
  object-fit: cover;
}

.inspection-review-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.8rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}

.inspection-review-actions .button {
  margin: 0;
}

.inspection-review-actions__status {
  margin: 0;
  color: var(--text-muted);
  font-weight: var(--font-weight-body);
}

.inspection-review-actions__status--success {
  color: var(--brand-green-800);
}

.inspection-review-actions__status--error {
  color: #a12020;
}

.inspection-history-photos {
  display: grid;
  width: min(100%, 42rem);
  gap: 0.6rem;
  margin-top: 0.9rem;
  padding: 0.75rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 0.7rem;
}

.inspection-history-photo-comparison {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: start;
  gap: 1rem;
  margin-top: 0.9rem;
}

.inspection-history-photo-comparison > .inspection-history-photos {
  width: 100%;
  margin-top: 0;
  grid-row: span 6;
  grid-template-rows: subgrid;
  align-self: stretch;
  align-content: start;
}

.inspection-history-photos__comments {
  display: grid;
  align-content: start;
  gap: 0.6rem;
}

.inspection-review-photo-comparison {
  display: grid;
  gap: 0.75rem;
}

.inspection-history-photos__empty {
  display: grid;
  aspect-ratio: 4 / 3;
  place-items: center;
  padding: 1rem;
  color: var(--text-muted);
  text-align: center;
  background: var(--surface-muted);
  border-radius: 0.55rem;
}

.inspection-history-photos__comments p,
.inspection-remediation-photo-pair__comment p {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

@media (min-width: 901px) {
  .inspection-history-photo-comparison .inspection-history-photos__heading { grid-row: 1; }
  .inspection-history-photo-comparison .inspection-history-photos__violation-badge { grid-row: 2; }
  .inspection-history-photo-comparison .inspection-history-photos__frame { grid-row: 3; }
  .inspection-history-photo-comparison .inspection-history-photos__empty { grid-row: 3; }
  .inspection-history-photo-comparison .inspection-history-photos__comments { grid-row: 4; }
  .inspection-history-photo-comparison .inspection-history-photos__meta { grid-row: 5; }
  .inspection-history-photo-comparison .inspection-history-photos__controls { grid-row: 6; }
}

@media (max-width: 900px) {
  .inspection-history-photo-comparison {
    grid-template-columns: 1fr;
  }

  .inspection-history-photo-comparison > .inspection-history-photos {
    grid-row: auto;
    grid-template-rows: none;
  }

}

.inspection-history-photos--violation .inspection-history-photos__frame {
  border-color: var(--brand-coral);
}

.inspection-history-photos--clean .inspection-history-photos__frame {
  border-color: var(--inspection-photo-accepted);
}

.inspection-history-photos__violation-badge {
  width: fit-content;
  padding: 0.35rem 0.55rem;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 0.45rem;
}

.inspection-history-photos__frame {
  display: grid;
  overflow: hidden;
  aspect-ratio: 4 / 3;
  place-items: center;
  background: #151915;
  border: 5px solid transparent;
  border-radius: 0.55rem;
}

.inspection-history-photos__frame img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.inspection-history-photos__meta {
  color: var(--text-muted);
}

.inspection-history-photos__violation-comments {
  display: grid;
  gap: 0.5rem;
}

.inspection-history-photos__violation-comments[hidden] {
  display: none;
}

.inspection-history-photos__manager-comments {
  display: grid;
  gap: 0.55rem;
}

.inspection-history-photos__manager-comments[hidden] {
  display: none;
}

.inspection-history-photos__manager-comment {
  color: var(--text);
}

.inspection-history-photos__manager-comment p {
  margin: 0.35rem 0 0;
  white-space: pre-wrap;
}

.inspection-history-photos__violation-comment {
  color: var(--text);
}

.inspection-comment-field {
  display: grid;
  align-content: start;
  gap: 0.4rem;
}

.inspection-comment-field__label {
  display: block;
  color: var(--text);
}

.inspection-comment-field__body {
  padding: 0.7rem 0.8rem;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 0.65rem;
}

.inspection-history-photos__violation-comment p {
  margin: 0.35rem 0;
}

.inspection-detail__violation-photo-count {
  display: block;
  margin-top: 0.4rem;
  color: #7c2014;
  font-weight: var(--font-weight-body);
}

.inspection-history-photos__controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
}

.inspection-history-photos__controls .button {
  margin: 0;
}

.inspection-history-photos__controls span {
  min-width: 4.5rem;
  text-align: center;
  font-weight: var(--font-weight-body);
}

.inspection-controls {
  display: grid;
  gap: 1rem;
}

.inspection-store-filter {
  min-width: 0;
  margin: 0;
  padding: 1rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 1rem;
}

.inspection-store-filter__title {
  margin: 0 0 0.85rem;
  color: var(--brand-green-950);
  font-weight: var(--font-weight-body);
}

.single-store-summary {
  margin: 0;
  padding: 1rem 1.25rem;
  color: var(--brand-green-950);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 1rem;
  font-weight: var(--font-weight-body);
}

.multi-select-field {
  min-width: 0;
}

.review-filters {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

.review-filters--with-period {
  grid-template-columns: 18rem minmax(0, 1fr) minmax(0, 31.25%);
  align-items: start;
}

.review-period-picker {
  width: 100%;
  max-width: 22rem;
  min-width: min(18rem, calc(100vw - 3rem));
  right: auto;
}

.review-period-picker__heading,
.review-period-picker__actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.65rem;
}

.review-period-picker__heading .button,
.review-period-picker__actions .button {
  margin: 0;
}

.review-period-picker__grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 0.2rem;
  text-align: center;
}

.review-period-picker__day {
  min-width: 0;
  margin: 0;
  min-height: 2.4rem;
  padding: 0.3rem 0;
  color: var(--text);
  background: var(--surface);
  border: 1px solid transparent;
  border-radius: 0.45rem;
  font: inherit;
  cursor: pointer;
}

.review-period-picker__day:hover,
.review-period-picker__day--selected {
  background: var(--brand-purple-50);
  border-color: var(--brand-purple);
}

.review-period-picker__day:focus-visible {
  outline: 2px solid var(--brand-purple);
  outline-offset: 1px;
}

.review-period-picker__hint {
  min-height: 2.5rem;
  margin: 0.6rem 0;
  color: var(--text-muted);
  font-size: 0.85rem;
}

.review-period-picker__actions {
  justify-content: flex-end;
  margin-bottom: 0;
}

@media (max-width: 900px) {
  .review-filters--with-period { grid-template-columns: 1fr; }
}

.review-tabs {
  margin-top: 1rem;
}

.inspection-type-tab:disabled {
  cursor: not-allowed;
  opacity: 0.65;
}

.inspection-store-filter__search {
  max-width: 34rem;
}

.inspection-store-filter__selection {
  display: grid;
  grid-template-columns: max-content minmax(0, 1fr);
  align-items: start;
  gap: 1rem;
  margin: 0.85rem 0;
}

.inspection-store-filter__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.inspection-store-filter__actions .button {
  margin: 0;
}

.inspection-store-options {
  display: grid;
  height: clamp(12rem, 28vh, 18rem);
  align-content: start;
  gap: 0.5rem;
  padding: 0.7rem;
  overflow-y: auto;
  overscroll-behavior: contain;
  background: var(--surface-muted);
  border: 1px solid var(--border);
  border-radius: 0.75rem;
  scrollbar-color: var(--brand-green-200) transparent;
}

.inspection-store-option {
  display: flex;
  width: 100%;
  align-items: center;
  gap: 0.45rem;
  padding: 0.65rem 0.8rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 0.65rem;
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: var(--font-weight-body);
}

.inspection-store-option input {
  width: 1rem;
  height: 1rem;
  accent-color: var(--brand-green-800);
}

.inspection-store-options__empty {
  color: var(--text-muted);
}

.inspection-detail__attachments li {
  display: grid;
  gap: 0.2rem;
}

.inspection-detail__attachments a {
  width: fit-content;
  color: var(--brand-green-800);
  font-weight: var(--font-weight-accent);
}

.inspection-detail__attachments small {
  color: var(--text-muted);
}

.inspection-type-tabs {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.5rem;
  padding: 0.4rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 1rem;
}

.inspection-type-tab {
  display: flex;
  min-height: 3.25rem;
  align-items: center;
  justify-content: center;
  gap: 0.65rem;
  padding: 0.65rem 1rem;
  color: var(--text-muted);
  background: transparent;
  border: 0;
  border-radius: 0.7rem;
  cursor: pointer;
  font: inherit;
  font-weight: var(--font-weight-body);
}

.inspection-type-tab[aria-selected='true'] {
  color: #ffffff;
  background: var(--brand-green-800);
}

.inspection-type-tab[aria-selected='true'] .count-badge {
  color: var(--brand-green-950);
  background: var(--brand-green-50);
}

.inspection-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 22rem), 1fr));
  gap: 1rem;
  margin: 1rem 0 0;
  padding: 0;
  list-style: none;
}

.overview-table-shell {
  margin-top: 1rem;
  overflow-x: auto;
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: 1rem;
  box-shadow: 0 0.65rem 1.8rem rgba(36, 38, 42, 0.07);
}

.overview-table {
  width: 100%;
  min-width: 48rem;
  border-spacing: 0;
  border-collapse: separate;
  color: var(--text);
  font-size: 1rem;
}

.overview-table th {
  padding: 0.9rem 1.15rem;
  color: #555b63;
  text-align: left;
  background: #f3f4f6;
  border-bottom: 1px solid var(--border);
  font-size: 0.85rem;
  font-weight: var(--font-weight-label);
  letter-spacing: 0.035em;
  text-transform: uppercase;
}

.overview-table th:first-child {
  border-top-left-radius: 1rem;
}

.overview-table th:last-child {
  border-top-right-radius: 1rem;
}

.overview-table__row {
  cursor: pointer;
  transition: background 140ms ease, box-shadow 140ms ease;
}

.overview-table__row:hover {
  background: #fff9f3;
  box-shadow: inset 0.25rem 0 #c8652a;
}

.overview-table__row:focus-visible {
  outline: 3px solid rgba(200, 101, 42, 0.28);
  outline-offset: -3px;
}

.overview-table__row[aria-disabled='true'] {
  cursor: wait;
  opacity: 0.65;
}

.overview-table__row--overdue {
  background: #fffafa;
}

.overview-table__row--selecting[aria-selected='true'] {
  background: #f4faf6;
  box-shadow: inset 0.25rem 0 #237a47;
}

.overview-table__selection-header,
.overview-table__selection-cell {
  width: 3.5rem;
  padding-right: 0;
  text-align: center;
}

.overview-table__selection-checkbox {
  appearance: none;
  display: inline-grid;
  width: 1.35rem;
  height: 1.35rem;
  margin: 0;
  vertical-align: middle;
  background: #ffffff;
  border: 2px solid #8a9098;
  border-radius: 50%;
  cursor: pointer;
  place-content: center;
}

.overview-table__selection-checkbox::before {
  width: 0.62rem;
  height: 0.62rem;
  background: #237a47;
  border-radius: 50%;
  content: '';
  transform: scale(0);
  transition: transform 120ms ease;
}

.overview-table__selection-checkbox:checked {
  border-color: #237a47;
}

.overview-table__selection-checkbox:checked::before {
  transform: scale(1);
}

.overview-table__selection-checkbox:focus-visible {
  outline: 3px solid rgba(35, 122, 71, 0.24);
  outline-offset: 0.15rem;
}

.overview-table__selection-checkbox:disabled {
  cursor: not-allowed;
  background: #eef0f2;
  border-color: #c7cbd0;
}

.overview-table td {
  padding: 1rem 1.15rem;
  vertical-align: middle;
  border-bottom: 1px solid #e8eaee;
  line-height: 1.4;
}

.overview-table__row:last-child td {
  border-bottom: 0;
}

.overview-table td strong,
.overview-table td span:not(.record-state) {
  display: block;
}

.overview-table td strong {
  color: #292b30;
  font-size: 1.05rem;
  font-weight: var(--font-weight-body);
}

.overview-table td span:not(.record-state) {
  margin-top: 0.2rem;
  color: var(--text-muted);
  font-size: 0.92rem;
}

.overview-table__status-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.overview-table__row-actions {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 0.45rem;
}

.overview-table .record-state {
  width: fit-content;
  font-size: 0.9rem;
  white-space: nowrap;
}

.overview-table .inspection-card__cancel,
.overview-table .inspection-card__renew {
  position: static;
  flex: 0 0 auto;
}

.record-state--attention {
  color: #853500;
  background: #fff0df;
  border-color: #efbd83;
}

.record-state--pending {
  color: #284f7b;
  background: #eaf3ff;
  border-color: #b8d2f2;
}

@media (max-width: 760px) {
  .overview-table-shell {
    overflow: visible;
    background: transparent;
    border: 0;
    border-radius: 0;
    box-shadow: none;
  }

  .overview-table {
    min-width: 0;
  }

  .overview-table thead {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
    clip-path: inset(50%);
  }

  .overview-table,
  .overview-table tbody,
  .overview-table__row,
  .overview-table td {
    display: block;
    width: 100%;
  }

  .overview-table tbody {
    display: grid;
    gap: 0.8rem;
  }

  .overview-table__row {
    overflow: hidden;
    background: #ffffff;
    border: 1px solid var(--border);
    border-radius: 0.9rem;
    box-shadow: 0 0.45rem 1.3rem rgba(36, 38, 42, 0.06);
  }

  .overview-table__row--overdue {
    border-left: 0.3rem solid var(--brand-coral);
  }

  .overview-table td {
    display: grid;
    grid-template-columns: minmax(7.5rem, 0.7fr) minmax(0, 1fr);
    align-items: center;
    gap: 0.75rem;
    padding: 0.8rem 1rem;
    border-bottom: 1px solid #e8eaee;
  }

  .overview-table td::before {
    color: var(--text-muted);
    content: attr(data-label);
    font-size: 0.78rem;
    font-weight: var(--font-weight-label);
    letter-spacing: 0.025em;
    text-transform: uppercase;
  }

  .overview-table td:last-child {
    border-bottom: 0;
  }

  .overview-table__selection-cell {
    grid-template-columns: minmax(7.5rem, 0.7fr) minmax(0, 1fr);
    width: 100%;
    padding-right: 1rem;
    text-align: left;
  }

  .overview-table .record-state {
    white-space: normal;
  }
}

.inspection-card {
  position: relative;
  min-width: 0;
  padding: 1rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 0.3rem solid var(--brand-green-800);
  border-radius: 0.9rem;
  box-shadow: 0 0.5rem 1.5rem rgba(6, 61, 22, 0.06);
}

.inspection-card--overdue {
  border-left-color: var(--brand-coral);
}

.inspection-card__summary {
  width: 100%;
  padding: 0 2.75rem 0 0;
  color: inherit;
  text-align: left;
  background: transparent;
  border: 0;
  cursor: pointer;
  font: inherit;
}

.inspection-card__cancel {
  position: absolute;
  top: 0.7rem;
  right: 0.7rem;
  display: grid;
  width: 2rem;
  height: 2rem;
  padding: 0;
  color: #8b2d22;
  background: #fff4f1;
  border: 1px solid #efb7ae;
  border-radius: 50%;
  cursor: pointer;
  font: 800 1.25rem/1 sans-serif;
  place-items: center;
}

.inspection-card__cancel:hover {
  color: #ffffff;
  background: #c83f2b;
  border-color: #c83f2b;
}

.inspection-card__cancel:focus-visible {
  outline: 3px solid rgba(200, 63, 43, 0.25);
  outline-offset: 0.15rem;
}

.inspection-card__cancel:disabled {
  cursor: wait;
  opacity: 0.55;
}

.inspection-card__renew {
  display: grid;
  width: 2rem;
  height: 2rem;
  padding: 0;
  color: #176237;
  background: #eef9f2;
  border: 1px solid #9fd2b1;
  border-radius: 50%;
  cursor: pointer;
  font: 800 1.25rem/1 sans-serif;
  place-items: center;
}

.inspection-card__renew:hover {
  color: #ffffff;
  background: #237a47;
  border-color: #237a47;
}

.inspection-card__renew:focus-visible {
  outline: 3px solid rgba(35, 122, 71, 0.25);
  outline-offset: 0.15rem;
}

.inspection-card__renew:disabled {
  cursor: wait;
  opacity: 0.55;
}

.overview-bulk-cancel-dialog,
.overview-export-dialog,
.renew-overdue-dialog {
  width: min(31rem, calc(100vw - 2rem));
  padding: 0;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 1rem;
  box-shadow: 0 1.5rem 4rem rgba(22, 31, 25, 0.24);
}

.overview-export-dialog {
  width: min(46rem, calc(100vw - 2rem));
}

.overview-bulk-cancel-dialog::backdrop,
.overview-export-dialog::backdrop,
.renew-overdue-dialog::backdrop {
  background: rgba(20, 29, 23, 0.48);
  backdrop-filter: blur(2px);
}

.overview-bulk-cancel-dialog__form,
.overview-export-dialog__form,
.renew-overdue-dialog__form {
  display: grid;
  gap: 1.1rem;
  padding: 1.5rem;
}

.overview-bulk-cancel-dialog h2,
.overview-export-dialog h2,
.renew-overdue-dialog h2 {
  margin: 0.25rem 0 0;
  font-size: 1.45rem;
}

.overview-bulk-cancel-dialog__description,
.overview-export-dialog__description,
.renew-overdue-dialog__description {
  margin: 0.5rem 0 0;
  color: var(--text-muted);
  line-height: 1.45;
}

.overview-bulk-cancel-dialog .form-actions,
.overview-export-dialog .form-actions,
.renew-overdue-dialog .form-actions {
  margin-top: 0;
}

.overview-export-dialog__form > .button--compact {
  justify-self: start;
}

.overview-export-columns {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.65rem;
  max-height: min(25rem, 55vh);
  padding: 0.15rem;
  overflow-y: auto;
}

.overview-export-column {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.65rem;
  min-height: 3.25rem;
  padding: 0.7rem 0.8rem;
  color: var(--text);
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: 0.75rem;
  cursor: pointer;
  font-weight: var(--font-weight-label);
}

.overview-export-column:hover {
  border-color: #8eb39a;
  box-shadow: 0 0.25rem 0.8rem rgba(28, 74, 45, 0.08);
}

.overview-export-column input {
  width: 1.15rem;
  height: 1.15rem;
  margin: 0;
  accent-color: var(--brand-green-700);
}

.overview-export-column small {
  color: var(--text-muted);
  font-size: 0.74rem;
  font-weight: var(--font-weight-body);
}

.overview-export-column--required {
  background: #f2f7f3;
  cursor: default;
}

.overview-export-column--required:hover {
  border-color: var(--border);
  box-shadow: none;
}

@media (max-width: 620px) {
  .overview-export-columns {
    grid-template-columns: 1fr;
  }
}

.inspection-card__summary::after {
  display: block;
  margin-top: 0.75rem;
  color: var(--brand-green-800);
  content: 'Открыть проверку';
  font-size: 0.8rem;
  font-weight: var(--font-weight-accent);
}

.inspection-card__summary:focus-visible {
  border-radius: 0.5rem;
  outline: 3px solid rgba(92, 143, 214, 0.35);
  outline-offset: 0.3rem;
}

.inspection-card__heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
}

.inspection-card__store {
  display: inline-block;
  margin: 0.8rem 0 0;
  padding: 0.35rem 0.55rem;
  color: #ffffff;
  background: var(--brand-green-950);
  border-radius: 0.45rem;
  font-size: 0.85rem;
  font-weight: var(--font-weight-body);
}

.inspection-card__meta {
  margin: 0.65rem 0 0;
  color: var(--text-muted);
  line-height: 1.45;
}

.inspection-detail h4 {
  margin: 1rem 0 0.6rem;
  color: var(--brand-green-950);
  font-size: 0.95rem;
}

.inspection-detail {
  padding-inline: clamp(0.5rem, 1.5vw, 1.25rem);
}

.inspection-detail__description {
  padding: 0.85rem;
  background: var(--surface-muted);
  border-radius: 0.7rem;
}

.inspection-detail__items,
.inspection-detail__attachments {
  display: grid;
  gap: 0.65rem;
  margin: 0;
  padding-left: 1.35rem;
}

.inspection-detail__item {
  padding: 1rem;
  background: var(--surface-muted);
  border: 1px solid var(--border);
  border-radius: 0.8rem;
}

.inspection-detail__items span {
  display: block;
  margin-top: 0.25rem;
  color: var(--text-muted);
  font-size: 0.85rem;
}

.inspection-detail__comment {
  margin-top: 0.85rem;
}

.inspection-detail__comment-control {
  position: relative;
}

.comment-editor {
  display: grid;
  gap: 0.4rem;
  min-width: 0;
}

.field .comment-editor textarea {
  box-sizing: border-box;
  width: 100%;
  padding-right: 3.8rem;
}

.inspection-detail__comment textarea {
  width: 100%;
  min-height: 7rem;
  padding: 0.8rem 3.8rem 0.8rem 0.8rem;
  color: var(--text);
  background: var(--surface);
  border: 1px solid #aeb9ca;
  border-radius: 0.65rem;
  resize: vertical;
  font: inherit;
  line-height: 1.45;
}

.inspection-detail__comment-save {
  position: absolute;
  top: 50%;
  right: 0.55rem;
  display: grid;
  width: 2.65rem;
  height: 2.65rem;
  padding: 0;
  color: #ffffff;
  background: var(--brand-green-800);
  border: 0;
  border-radius: 50%;
  cursor: pointer;
  place-items: center;
  transform: translateY(-50%);
}

.inspection-detail__comment-save:hover {
  background: var(--brand-green-950);
}

.inspection-detail__comment-save:focus-visible {
  outline: 0.2rem solid rgba(11, 98, 24, 0.3);
  outline-offset: 0.15rem;
}

.inspection-detail__comment-save:disabled {
  cursor: wait;
  opacity: 0.65;
}

.inspection-detail__comment-save svg {
  width: 1.35rem;
  height: 1.35rem;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

.inspection-detail__comment textarea:focus-visible {
  border-color: var(--brand-green-800);
  outline: 0.2rem solid rgba(11, 98, 24, 0.18);
  outline-offset: 0.1rem;
}

.inspection-detail__answer-author {
  color: var(--text-muted);
  font-size: 0.8rem;
  font-weight: var(--font-weight-body);
}

.inspection-detail__comment-status {
  color: var(--text-muted);
  font-size: 0.8rem;
  font-weight: var(--font-weight-body);
}

.inspection-detail__comment-status--success {
  color: var(--brand-green-800);
}

.inspection-detail__comment-status--error {
  color: #a12020;
}

.inspection-item-attachments {
  display: grid;
  gap: 0.65rem;
  margin-top: 0.85rem;
  padding: 0.8rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 0.7rem;
}

.inspection-item-attachments__heading,
.inspection-item-attachments__list li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.inspection-item-attachments__heading .button,
.inspection-item-attachments__list .button {
  flex: 0 0 auto;
  margin: 0;
}

.inspection-item-attachments__list {
  display: grid;
  gap: 0.5rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.inspection-item-attachments__list li {
  padding: 0.65rem;
  background: var(--surface-muted);
  border-radius: 0.55rem;
}

.inspection-item-attachments__main {
  display: grid;
  min-width: 0;
  gap: 0.15rem;
}

.inspection-item-attachments__main a {
  overflow-wrap: anywhere;
  color: var(--brand-green-950);
  font-weight: var(--font-weight-accent);
}

.inspection-item-attachments__main small {
  color: var(--text-muted);
}

.inspection-item-attachments__status {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.85rem;
  font-weight: var(--font-weight-body);
}

.inspection-item-attachments__status--success {
  color: var(--brand-green-800);
}

.inspection-item-attachments__status--error {
  color: #a12020;
}

.inspection-photos {
  display: grid;
  gap: 0.75rem;
  margin-top: 0.85rem;
  padding: 0.8rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 0.7rem;
}

.inspection-photos__heading,
.inspection-photos__pending-heading,
.inspection-photos__actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.65rem;
}

.inspection-photos__heading,
.inspection-photos__pending-heading {
  justify-content: space-between;
}

.inspection-photos__counter {
  color: var(--text-muted);
  font-size: 0.82rem;
  font-weight: var(--font-weight-body);
}

.inspection-photos__actions .button,
.inspection-photos__pending-heading .button {
  margin: 0;
}

.inspection-photos__camera-panels:empty {
  display: none;
}

.inspection-camera {
  display: grid;
  width: min(100%, 42rem);
  gap: 0.65rem;
  padding: 0.65rem;
  background: #151915;
  border-radius: 0.75rem;
}

.inspection-camera__video {
  display: block;
  width: 100%;
  max-height: 65dvh;
  background: #000000;
  border-radius: 0.55rem;
  object-fit: contain;
}

.inspection-camera__actions {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.65rem;
}

.inspection-camera__actions .button {
  margin: 0;
}

.inspection-photos__grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(8.5rem, 1fr));
  gap: 0.7rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.inspection-photos__confirmed .inspection-history-photos {
  margin-top: 0;
}

.inspection-photos__preview {
  position: relative;
  display: grid;
  min-width: 0;
  gap: 0.35rem;
  padding: 0.4rem;
  overflow: hidden;
  background: var(--surface-muted);
  border: 1px solid var(--border);
  border-radius: 0.65rem;
}

.inspection-photos__preview a {
  display: block;
  overflow: hidden;
  aspect-ratio: 4 / 3;
  background: var(--brand-green-50);
  border-radius: 0.45rem;
}

.inspection-photos__preview img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.inspection-photos__preview small {
  overflow: hidden;
  color: var(--text-muted);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.inspection-photos__remove {
  position: absolute;
  top: 0.7rem;
  right: 0.7rem;
  display: grid;
  width: 2rem;
  height: 2rem;
  padding: 0;
  place-items: center;
  color: #ffffff;
  background: rgba(36, 36, 36, 0.82);
  border: 1px solid rgba(255, 255, 255, 0.8);
  border-radius: 50%;
  cursor: pointer;
  font: inherit;
  font-size: 1.35rem;
  line-height: 1;
}

.inspection-photos__remove:focus-visible {
  outline: 0.2rem solid var(--brand-blue);
  outline-offset: 0.1rem;
}

.inspection-photos__pending {
  display: grid;
  gap: 0.65rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--border);
}

.inspection-photos__status {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.85rem;
  font-weight: var(--font-weight-body);
}

.inspection-photos__status--success {
  color: var(--brand-green-800);
}

.inspection-photos__status--error {
  color: #a12020;
}

.inspection-acknowledgement {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.65rem;
  margin-top: 0.85rem;
}

.inspection-acknowledgement .button {
  margin: 0;
}

.inspection-acknowledgement__status {
  color: var(--text-muted);
  font-size: 0.85rem;
  font-weight: var(--font-weight-body);
}

.inspection-detail__submission {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  padding-top: 18px;
  border-top: 1px solid var(--border);
}

.inspection-detail__submission-status {
  margin: 0;
}

.inspection-detail-screen {
  position: relative;
  z-index: 3;
  grid-column: 2;
  grid-row: 1 / -1;
  min-width: 0;
  height: 100dvh;
  padding: clamp(1rem, 3vw, 2.5rem);
  overflow-y: auto;
  color: var(--text);
  background: var(--surface-muted);
}

.inspection-detail-screen__header,
.inspection-detail-screen__content,
.inspection-detail-screen > .panel-status {
  width: min(100%, 112rem);
  margin-right: auto;
  margin-left: auto;
}

.inspection-detail-screen__header {
  display: grid;
  grid-template-columns: max-content minmax(0, 1fr);
  align-items: start;
  gap: 1rem;
  padding: 1rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 1rem;
  box-shadow: 0 0.75rem 2.5rem rgba(6, 61, 22, 0.08);
}

.inspection-detail-screen__header .button {
  margin-top: 0;
}

.inspection-detail-screen__header .eyebrow {
  margin-bottom: 0.35rem;
}

.inspection-detail-screen__header h2 {
  margin: 0;
  font-size: clamp(1.45rem, 3vw, 2.2rem);
}

.inspection-detail-screen__timing {
  margin: 0.55rem 0 0;
  color: var(--text-muted);
}

.inspection-detail-screen > .panel-status {
  margin-top: 1rem;
}

.inspection-detail-screen__content {
  margin-top: 1rem;
  padding: clamp(1rem, 3vw, 2rem);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 1rem;
  box-shadow: 0 0.75rem 2.5rem rgba(6, 61, 22, 0.06);
}

.record-state--overdue {
  color: #7c2014;
  background: var(--brand-coral-50);
}

@media (max-width: 620px) {
  .review-filters {
    grid-template-columns: 1fr;
  }

  .inspection-store-filter__selection {
    grid-template-columns: 1fr;
  }

  .inspection-type-tabs {
    grid-template-columns: 1fr;
  }

  .inspection-detail-screen__header {
    grid-template-columns: 1fr;
  }

}

.template-card-list {
  display: grid;
  gap: 0.75rem;
  margin: 1rem 0 0;
  padding: 0;
  list-style: none;
}

.template-card {
  padding: 1rem;
  background: #f8faf8;
  border: 1px solid #dde3dc;
  border-left: 0.3rem solid #5faf2d;
  border-radius: 0.8rem;
}

.template-card__summary {
  width: 100%;
  padding: 0;
  border: 0;
  color: inherit;
  font: inherit;
  text-align: left;
  background: transparent;
  cursor: pointer;
}

.template-card__summary:focus-visible {
  outline: 3px solid rgba(0, 102, 51, 0.28);
  outline-offset: 5px;
  border-radius: 8px;
}

.template-card__summary::after {
  display: block;
  margin-top: 10px;
  color: #0f5a05;
  font-size: 0.78rem;
  font-weight: var(--font-weight-accent);
  content: 'Открыть карточку';
}

.template-card__summary[aria-expanded='true']::after {
  content: 'Свернуть карточку';
}

.template-card__expanded {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid #d9e1d6;
}

.template-card__expanded h5 {
  margin: 16px 0 8px;
  font-size: 0.92rem;
}

.template-card__expanded-row {
  margin: 6px 0;
  color: #596273;
  line-height: 1.45;
}

.template-card__expanded-row strong {
  color: #172033;
}

.template-card__items {
  display: grid;
  gap: 10px;
  margin: 0;
  padding-left: 22px;
}

.template-card__items li span,
.template-card__items li small {
  display: block;
}

.version-history {
  margin-top: 16px;
  padding: 14px;
  border: 1px solid #d9e1d6;
  border-radius: 10px;
  background: #fff;
}

.version-history__list {
  display: grid;
  gap: 12px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.version-history__list > li {
  padding: 12px;
  border-left: 3px solid #5faf2d;
  border-radius: 8px;
  background: #f8faf8;
}

.version-history__heading {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-bottom: 8px;
}

.version-history__heading > span:last-child {
  color: var(--text-muted);
  font-size: 0.86rem;
}

.version-history__changes {
  margin: 10px 0;
  padding: 10px 12px;
  border-radius: 8px;
  background: #edf7e8;
}

.version-history__changes > strong {
  color: #116b12;
}

.version-history__changes ul {
  margin: 6px 0 0;
  padding-left: 20px;
}

.template-card__expanded > .button {
  margin-top: 16px;
}

.template-card__items li small {
  margin-top: 3px;
  color: #596273;
}

.template-card--assignment {
  border-left-color: #f02d2d;
}

.template-card h4 {
  margin: 0;
  color: #172019;
  font-size: 1.05rem;
  line-height: 1.35;
}

.template-card__meta,
.template-card__detail {
  margin: 0.55rem 0 0;
  color: var(--text-muted);
  line-height: 1.45;
}

.template-card__detail--strong {
  color: #263029;
  font-weight: var(--font-weight-body);
}

.record-state {
  flex: 0 0 auto;
  padding: 0.25rem 0.55rem;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: var(--font-weight-body);
}

.record-state--active {
  color: #0f5a05;
  background: #eafbdc;
}

.record-state--inactive {
  color: var(--text-muted);
  background: #e9e9e6;
}

.store-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 0.75rem;
}

.store-chip {
  padding: 0.28rem 0.55rem;
  color: #ffffff;
  background: #003e14;
  border-radius: 0.45rem;
  font-size: 0.8rem;
  font-weight: var(--font-weight-accent);
}

@media (max-width: 1100px) {
  .overview-filters {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .template-columns {
    grid-template-columns: 1fr;
  }
}

/* Фирменная палитра элементов управления */

.eyebrow {
  color: var(--brand-green-800);
}

.field input:focus-visible,
.field select:focus-visible,
.field textarea:focus-visible,
.password-visibility:focus-visible,
.management-tab:focus-visible,
.store-filter-tab:focus-visible,
.access-user-button:focus-visible,
.button:focus-visible {
  outline-color: rgba(92, 143, 214, 0.55);
}

.password-visibility:hover {
  color: #0f5a05;
  background: #eafbdc;
}

.button {
  background: #0f5a05;
  border-color: #0f5a05;
}

.button:hover {
  background: #05310a;
}

.button--secondary {
  color: #0f5a05;
  background: #ffffff;
}

.button--secondary:hover {
  background: #eafbdc;
}

.management-tabs {
  background: #e9e9e6;
  border-color: #d5d6d1;
}

.management-tab[aria-selected='true'] {
  color: #003e14;
  background: #5faf2d;
}

.store-filter-tab {
  color: #0f5a05;
  border-color: #5faf2d;
}

.store-filter-tab[aria-pressed='true'],
.access-user-button[aria-pressed='true'] {
  color: #003e14;
  background: #5faf2d;
  border-color: #5faf2d;
}

.access-store-option input {
  accent-color: #0f5a05;
}

@media (max-width: 760px) {
  .auth-card.application-mode,
  .auth-card.application-mode.sidebar-collapsed {
    grid-template-columns: 4.75rem minmax(0, 1fr);
  }

  .app-sidebar {
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    width: min(18rem, calc(100vw - 1rem));
    box-shadow: 0.75rem 0 2rem rgba(0, 0, 0, 0.18);
    transition: width 180ms ease;
  }

  .sidebar-collapsed .app-sidebar {
    width: 4.75rem;
    box-shadow: none;
  }

  .workspace-header,
  .workspace-panel {
    grid-column: 2;
  }
}

.network-status {
  padding: 0.75rem 1rem;
  color: #5d2b00;
  background: #fff0d9;
  border-bottom: 1px solid #f0c486;
  text-align: center;
  font-weight: var(--font-weight-body);
}

.page-shell {
  display: grid;
  min-height: 100vh;
  padding: 1.5rem;
  place-items: center;
}

.auth-card {
  width: min(100%, 44rem);
  padding: clamp(1.5rem, 5vw, 3rem);
  background: #ffffff;
  border: 1px solid #dce3ef;
  border-radius: 1.25rem;
  box-shadow: 0 1.25rem 3rem rgba(27, 50, 91, 0.12);
}

.eyebrow {
  margin: 0 0 0.75rem;
  color: #174ea6;
  font-size: 0.875rem;
  font-weight: var(--font-weight-body);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

h1 {
  margin: 0;
  font-size: clamp(2rem, 7vw, 3.5rem);
  line-height: 1.05;
}

.auth-card__text {
  max-width: 36rem;
  margin: 1.25rem 0 0;
  color: var(--text-muted);
  font-size: clamp(1rem, 2.5vw, 1.125rem);
  line-height: 1.6;
}

.panel-status,
.auth-card__text {
  color: var(--text-muted);
}

.panel-status {
  margin-top: 2rem;
  font-weight: var(--font-weight-body);
}

.login-form,
.session-panel,
.management-panel {
  margin-top: 2rem;
}

.application-mode .workspace-panel.management-panel {
  margin-top: 0;
}

.field {
  display: grid;
  gap: 0.5rem;
  margin-top: 1rem;
  color: #344158;
  font-weight: var(--font-weight-label);
}

.field input,
.field select,
.field textarea {
  width: 100%;
  min-height: 3rem;
  padding: 0.75rem 0.875rem;
  color: #172033;
  background: #ffffff;
  border: 1px solid #aeb9ca;
  border-radius: 0.625rem;
  font: inherit;
}

.field textarea {
  min-height: 5.5rem;
  resize: vertical;
}

.password-control {
  position: relative;
  display: block;
}

.password-control input {
  padding-right: 3.5rem;
}

.password-visibility {
  position: absolute;
  top: 50%;
  right: 0.25rem;
  display: grid;
  width: 2.75rem;
  height: 2.75rem;
  padding: 0;
  color: var(--text-muted);
  background: transparent;
  border: 0;
  border-radius: 0.5rem;
  cursor: pointer;
  place-items: center;
  transform: translateY(-50%);
}

.password-visibility:hover {
  color: #174ea6;
  background: #edf3fc;
}

.password-visibility svg {
  width: 1.5rem;
  height: 1.5rem;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.75;
}

.password-visibility[aria-pressed="true"] svg {
  opacity: 0.65;
}

.field input:focus-visible,
.field select:focus-visible,
.field textarea:focus-visible,
.password-visibility:focus-visible,
.management-tab:focus-visible,
.store-filter-tab:focus-visible,
.access-user-button:focus-visible,
.button:focus-visible {
  outline: 0.2rem solid rgba(23, 78, 166, 0.3);
  outline-offset: 0.15rem;
}

.button {
  min-height: 3rem;
  margin-top: 1.25rem;
  padding: 0.75rem 1.25rem;
  color: #ffffff;
  background: #174ea6;
  border: 1px solid #174ea6;
  border-radius: 0.625rem;
  cursor: pointer;
  font: inherit;
  font-weight: var(--font-weight-accent);
}

.button:hover {
  background: #103f8a;
}

.button:disabled {
  cursor: wait;
  opacity: 0.65;
}

.button--secondary {
  color: #174ea6;
  background: #ffffff;
}

.button--secondary:hover {
  background: #edf3fc;
}

.button--compact {
  min-height: 2.75rem;
  margin-top: 0;
  padding: 0.625rem 1rem;
}

.form-message {
  margin: 1rem 0 0;
}

.form-message--error {
  color: #a12020;
  font-weight: var(--font-weight-body);
}

.status-badge {
  display: inline-block;
  margin: 0 0 1rem;
  padding: 0.35rem 0.65rem;
  color: #17652a;
  background: #e7f6eb;
  border-radius: 999px;
  font-size: 0.875rem;
  font-weight: var(--font-weight-body);
}

h2 {
  margin: 0;
  font-size: clamp(1.35rem, 4vw, 2rem);
}

h3 {
  margin: 0;
  font-size: 1.125rem;
}

.management-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
}

.management-header .eyebrow {
  margin-bottom: 0.5rem;
}

.management-tabs {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.35rem;
  margin-top: 1.5rem;
  padding: 0.35rem;
  background: #e9eef6;
  border: 1px solid #d2dbe8;
  border-radius: 0.85rem;
}

.management-tab {
  min-height: 3rem;
  padding: 0.65rem 1rem;
  color: #536078;
  background: transparent;
  border: 0;
  border-radius: 0.65rem;
  font: inherit;
  font-weight: var(--font-weight-body);
  cursor: pointer;
}

.management-tab[aria-selected='true'] {
  color: #14213d;
  background: #ffffff;
  box-shadow: 0 0.15rem 0.45rem rgba(20, 33, 61, 0.14);
}

.store-filter-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 1.5rem;
}

.store-filter-tab {
  min-height: 2.5rem;
  padding: 0.5rem 0.9rem;
  color: #174ea6;
  background: #ffffff;
  border: 1px solid #174ea6;
  border-radius: 999px;
  font: inherit;
  font-weight: var(--font-weight-body);
  cursor: pointer;
}

.store-filter-tab[aria-pressed='true'] {
  color: #ffffff;
  background: #174ea6;
}

.form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.management-form,
.users-section,
.stores-section {
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 1px solid #e4e9f1;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0 1rem;
}

#create-user-form {
  padding: 1.5rem;
}

.form-grid .field:last-child {
  grid-column: 1 / -1;
}

.password-result {
  margin-top: 1.5rem;
  padding: 1rem;
  background: #fff8e8;
  border: 1px solid #efcc7a;
  border-radius: 0.75rem;
}

.password-result p {
  margin: 0.5rem 0 0;
  color: #664b0b;
  line-height: 1.5;
}

.generated-password {
  display: block;
  margin: 1rem 0;
  padding: 0.75rem;
  overflow-wrap: anywhere;
  color: #172033;
  background: #ffffff;
  border: 1px solid #d8b65f;
  border-radius: 0.5rem;
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  font-size: 1.125rem;
  font-weight: var(--font-weight-body);
  user-select: all;
}

.users-list,
.stores-list {
  display: grid;
  gap: 0.75rem;
  margin: 1rem 0 0;
  padding: 0;
  list-style: none;
}

.store-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.35rem 1rem;
  padding: 1rem;
  background: #f8faff;
  border: 1px solid #dce3ef;
  border-radius: 0.75rem;
}

.store-card__title {
  margin: 0;
  font-weight: var(--font-weight-body);
}

.store-card__state {
  grid-column: 1;
  margin: 0;
  color: var(--text-muted);
}

.store-card .button {
  grid-column: 2;
  grid-row: 1 / span 2;
  margin-top: 0;
}

.sessions-list {
  display: grid;
  gap: 0.75rem;
  margin: 1.5rem 0 0;
  padding: 0;
  list-style: none;
}

.session-card {
  padding: 1rem;
  background: #f8faff;
  border: 1px solid #dce3ef;
  border-radius: 0.75rem;
}

.session-card__title {
  margin: 0;
  font-weight: var(--font-weight-body);
}

.session-card__meta {
  margin: 0.35rem 0 0;
  color: var(--text-muted);
}

.session-card__badge {
  margin-bottom: 0.75rem;
}

.session-card .button {
  margin-top: 0.75rem;
}

.user-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.35rem 1rem;
  padding: 1rem;
  background: #f8faff;
  border: 1px solid #dce3ef;
  border-radius: 0.75rem;
}

.user-card__actions {
  display: flex;
  grid-column: 1 / -1;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.5rem;
}

.user-card__role-control {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.875rem;
  font-weight: var(--font-weight-label);
}

.user-card__role-control select {
  min-height: 2.5rem;
  padding: 0.45rem 2rem 0.45rem 0.65rem;
  color: #14213d;
  background: #ffffff;
  border: 1px solid #aebbd0;
  border-radius: 0.55rem;
}

.user-card__actions .button {
  min-height: 2.5rem;
  margin-top: 0;
  padding: 0.5rem 0.75rem;
  font-size: 0.875rem;
}

.button--danger {
  color: #a12020;
  background: #ffffff;
  border-color: #c75353;
}

.button--danger:hover {
  color: #ffffff;
  background: #a12020;
}

.button--danger:disabled,
.button--secondary:disabled {
  color: var(--text-muted);
  background: #eef1f6;
  border-color: #cbd3df;
  cursor: not-allowed;
}

.user-card__name {
  margin: 0;
  font-weight: var(--font-weight-body);
}

.user-card__login,
.user-card__meta {
  margin: 0;
  color: var(--text-muted);
}

.user-card__meta {
  grid-row: 1 / span 2;
  grid-column: 2;
  text-align: right;
}

.access-layout {
  display: grid;
  grid-template-columns: minmax(15rem, 0.8fr) minmax(18rem, 1.2fr);
  gap: 1rem;
  margin-top: 1.5rem;
}

.access-users-section,
.access-editor {
  min-width: 0;
  padding: 1rem;
  background: #f8faff;
  border: 1px solid #dce3ef;
  border-radius: 0.75rem;
}

.access-users-list,
.access-stores-list {
  display: grid;
  gap: 0.5rem;
  margin: 1rem 0 0;
  padding: 0;
  list-style: none;
}

.access-user-button {
  display: grid;
  width: 100%;
  gap: 0.25rem;
  padding: 0.75rem;
  color: #14213d;
  text-align: left;
  background: #ffffff;
  border: 1px solid #cbd5e4;
  border-radius: 0.65rem;
  cursor: pointer;
}

.access-user-button span,
.access-editor__description {
  color: var(--text-muted);
}

.access-user-button[aria-pressed='true'] {
  color: #ffffff;
  background: #174ea6;
  border-color: #174ea6;
}

.access-user-button[aria-pressed='true'] span {
  color: #e8f0ff;
}

.access-editor__description {
  margin: 0.5rem 0 0;
  line-height: 1.5;
}

.access-store-item {
  background: #ffffff;
  border: 1px solid #dce3ef;
  border-radius: 0.6rem;
}

.access-store-option {
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
  padding: 0.75rem;
  cursor: pointer;
}

.access-store-option input {
  width: 1.15rem;
  height: 1.15rem;
  margin: 0.1rem 0 0;
  accent-color: #174ea6;
}

.access-store-option span {
  line-height: 1.35;
}

.access-stores-list + .button {
  margin-top: 1rem;
}

.user-summary {
  display: grid;
  gap: 0.75rem;
  margin: 1.5rem 0 0;
}

.user-summary div {
  display: grid;
  grid-template-columns: minmax(6rem, 0.35fr) 1fr;
  gap: 1rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid #e4e9f1;
}

.user-summary dt {
  color: var(--text-muted);
}

.user-summary dd {
  margin: 0;
  font-weight: var(--font-weight-body);
}

@media (max-width: 480px) {
  .page-shell {
    padding: 1rem;
  }

  .auth-card {
    border-radius: 1rem;
  }

  .button {
    width: 100%;
  }

  .management-header,
  .form-section-header,
  .template-items-heading,
  .template-item__header,
  .template-column__header,
  .user-card,
  .store-card {
    display: grid;
  }

  .management-tabs,
  .access-layout,
  .template-requirements,
  .template-column__actions {
    grid-template-columns: 1fr;
  }

  .template-column__actions {
    display: grid;
    justify-content: stretch;
  }

  .form-grid {
    grid-template-columns: 1fr;
  }

  .form-grid .field:last-child,
  .user-card__meta {
    grid-column: auto;
  }

  .user-card__meta {
    grid-row: auto;
    text-align: left;
  }

  .store-card .button {
    grid-column: auto;
    grid-row: auto;
  }
}

/* Итоговые переопределения фирменной палитры должны идти после старых стилей. */

.eyebrow {
  color: #0f5a05;
}

.field input:focus-visible,
.field select:focus-visible,
.field textarea:focus-visible,
.password-visibility:focus-visible,
.management-tab:focus-visible,
.store-filter-tab:focus-visible,
.access-user-button:focus-visible,
.button:focus-visible {
  outline-color: rgba(95, 175, 45, 0.45);
}

.button {
  color: #ffffff;
  background: var(--brand-green-800);
  border-color: var(--brand-green-800);
}

.button:hover {
  background: var(--brand-green-950);
}

.button--secondary {
  color: var(--brand-green-800);
  background: var(--surface);
}

.button--secondary:hover {
  background: var(--brand-green-50);
}

.button--danger {
  color: #ffffff;
  background: #9e1b25;
  border-color: #9e1b25;
}

.button--danger:disabled,
.button--secondary:disabled {
  color: var(--text-muted);
  background: #eef1f6;
  border-color: #cbd3df;
}

.management-tabs {
  background: var(--brand-blue-50);
  border-color: #ccd9ec;
}

.management-tab[aria-selected='true'],
.store-filter-tab[aria-pressed='true'],
.access-user-button[aria-pressed='true'] {
  color: var(--brand-green-950);
  background: var(--brand-lime);
  border-color: var(--brand-lime);
}

.store-filter-tab {
  color: var(--brand-green-800);
  border-color: var(--brand-green-200);
}

.access-store-option input {
  accent-color: var(--brand-green-800);
}

.workspace-header,
.template-column,
.management-form,
.auth-card {
  background-color: var(--surface);
  border-color: var(--border);
}

.workspace-panel {
  background: var(--surface-muted);
}

.template-card,
.store-card,
.user-card,
.template-item {
  background: #fbfcfb;
  border-color: var(--border);
}

.template-card {
  border-left-color: var(--brand-lime);
}

.template-card--assignment {
  border-left-color: var(--brand-coral);
}

.count-badge,
.status-badge--active {
  color: var(--brand-green-950);
  background: var(--brand-green-50);
  border-color: var(--brand-green-200);
}

.status-badge--inactive {
  color: #633292;
  background: var(--brand-purple-50);
}

.store-code-badge {
  background: var(--brand-green-950);
}

.rich-text-toolbar {
  background: var(--brand-blue-50);
  border-color: #c8d7ec;
}

.rich-text-toolbar button:hover,
.rich-text-toolbar button:focus-visible,
.rich-text-toolbar select:focus-visible,
.rich-text-editor:focus {
  border-color: var(--brand-blue);
  outline-color: rgba(92, 143, 214, 0.28);
}

.description-highlight--red {
  background: #ffd6cc;
}

.description-highlight--green {
  background: var(--brand-green-200);
}

.description-highlight--gray {
  background: var(--brand-blue-50);
}

.option-field input {
  accent-color: var(--brand-green-800);
}

@media (max-width: 760px) {
  .assignment-store-selection {
    grid-template-columns: 1fr;
  }
}

/* Современная сине-фиолетовая тема бренда. */

.app-sidebar {
  background: var(--brand-primary-950);
  border-right-color: rgba(155, 91, 214, 0.55);
}

.sidebar-brand:hover,
.sidebar-nav__button:hover {
  background: rgba(231, 238, 251, 0.14);
}

.sidebar-nav__button[aria-current='page'] {
  color: #ffffff;
  background: var(--brand-purple);
  box-shadow: inset 0.2rem 0 var(--brand-pink);
}

.sidebar-footer {
  border-top-color: rgba(231, 238, 251, 0.22);
}

.sidebar-user__avatar {
  color: var(--brand-primary-950);
  background: var(--brand-primary-50);
}

.workspace-panel {
  background: var(--surface-muted);
}

.eyebrow,
.attachment-list__link,
.inspection-card__summary::after,
.inspection-detail h4 {
  color: var(--brand-primary-800);
}

.empty-state__icon {
  background: var(--brand-primary-800);
}

.empty-state__number {
  color: #633292;
  background: var(--brand-purple-50);
}

.button {
  color: #ffffff;
  background: var(--brand-primary-800);
  border-color: var(--brand-primary-800);
}

.button:hover {
  background: var(--brand-primary-950);
}

.button--secondary {
  color: var(--brand-primary-800);
  background: var(--surface);
  border-color: var(--brand-primary-200);
}

.button--secondary:hover {
  color: var(--brand-primary-950);
  background: var(--brand-primary-50);
}

.field input:focus-visible,
.field select:focus-visible,
.field textarea:focus-visible,
.password-visibility:focus-visible,
.management-tab:focus-visible,
.store-filter-tab:focus-visible,
.access-user-button:focus-visible,
.button:focus-visible,
.inspection-detail__comment textarea:focus-visible {
  border-color: var(--brand-blue);
  outline-color: rgba(92, 143, 214, 0.38);
}

.password-visibility:hover {
  color: var(--brand-primary-800);
  background: var(--brand-primary-50);
}

.management-tabs,
.inspection-type-tabs {
  background: var(--brand-primary-50);
  border-color: var(--brand-primary-200);
}

.management-tab[aria-selected='true'],
.store-filter-tab[aria-pressed='true'],
.access-user-button[aria-pressed='true'],
.inspection-type-tab[aria-selected='true'] {
  color: #ffffff;
  background: var(--brand-purple);
  border-color: var(--brand-purple);
}

.inspection-type-tab[aria-selected='true'] .count-badge {
  color: #633292;
  background: var(--brand-purple-50);
}

.store-filter-tab {
  color: var(--brand-primary-800);
  border-color: var(--brand-primary-200);
}

.access-store-option input,
.option-field input,
.inspection-review-decision input,
.inspection-store-option input {
  accent-color: var(--brand-purple);
}

.inspection-card {
  border-left-color: var(--brand-blue);
  box-shadow: 0 0.5rem 1.5rem rgba(38, 63, 115, 0.08);
}

.inspection-card--overdue {
  border-left-color: var(--brand-coral);
}

.inspection-card__store,
.store-code-badge,
.store-chip {
  color: #ffffff;
  background: var(--brand-primary-950);
}

.inspection-detail__comment-save {
  background: var(--brand-primary-800);
}

.inspection-detail__comment-save:hover {
  background: var(--brand-primary-950);
}

.inspection-detail-screen__header,
.inspection-detail-screen__content {
  box-shadow: 0 0.75rem 2.5rem rgba(38, 63, 115, 0.08);
}

.template-card {
  border-left-color: var(--brand-purple);
}

.template-card--assignment {
  border-left-color: var(--brand-coral);
}

.count-badge {
  color: #633292;
  background: var(--brand-purple-50);
  border-color: #d8baf0;
}

.status-badge--active,
.record-state--active {
  color: var(--brand-green-950);
  background: var(--brand-green-50);
  border-color: var(--brand-green-200);
}

.inspection-detail__item--review-accepted {
  background: var(--inspection-accepted-background);
  border-color: var(--border);
}

.inspection-detail__comment-status--success {
  color: var(--brand-green-800);
}

.rich-text-toolbar {
  background: var(--brand-blue-50);
  border-color: var(--brand-primary-200);
}

.combobox-options button:hover,
.combobox-options button:focus-visible,
.combobox-options button[aria-selected='true'] {
  color: var(--brand-primary-950);
  background: var(--brand-primary-50);
}

.assignment-store-list,
.inspection-store-options {
  scrollbar-color: var(--brand-primary-200) transparent;
}

.selected-store-chip {
  color: #633292;
  background: var(--brand-purple-50);
  border-color: var(--brand-purple-200);
}

.selected-store-chip:hover,
.selected-store-chip:focus-visible {
  background: var(--brand-purple-200);
}

.overview-metric strong,
.inspection-store-filter__title,
.single-store-summary {
  color: var(--brand-primary-950);
}

.inspection-detail__attachments a,
.inspection-item-attachments__main a,
.template-card__summary::after {
  color: var(--brand-primary-800);
}

.inspection-photos__preview a {
  background: var(--brand-primary-50);
}

.template-card__summary:focus-visible {
  outline-color: rgba(92, 143, 214, 0.38);
}

.version-history__list > li {
  background: #faf9fd;
  border-left-color: var(--brand-purple);
}

/* Светлая бело-серо-оранжевая тема со спокойными акцентами. */

.app-sidebar {
  color: #34383e;
  background: #e1e3e7;
  border-right-color: var(--border);
  box-shadow: 0.45rem 0 1.5rem rgba(42, 46, 52, 0.06);
}

.sidebar-brand,
.sidebar-nav__button,
.sidebar-brand__text,
.sidebar-nav__button--logout {
  color: #3b4047;
}

.sidebar-brand:hover,
.sidebar-nav__button:hover {
  color: #25292e;
  background: #d5d9dd;
}

.sidebar-brand:focus-visible,
.sidebar-nav__button:focus-visible {
  outline-color: rgba(200, 101, 42, 0.38);
}

.sidebar-nav__button[aria-current='page'] {
  color: #743814;
  background: #f8e5d7;
  box-shadow: inset 0.2rem 0 #c8652a;
}

.sidebar-footer {
  border-top-color: #d7dbe0;
}

.sidebar-user__details span {
  color: var(--text-muted);
}

.sidebar-user__avatar {
  color: #6f2b00;
  background: #fff0e2;
}

.workspace-header {
  background: #ffffff;
  border-bottom-color: var(--border);
  box-shadow: 0 0.35rem 1.4rem rgba(36, 38, 42, 0.05);
}

.workspace-panel {
  background: var(--surface-muted);
}

.workspace-card,
.template-column,
.management-form,
.inspection-store-filter,
.inspection-detail-screen__header,
.inspection-detail-screen__content {
  border-color: var(--border);
  box-shadow: 0 0.55rem 1.7rem rgba(36, 38, 42, 0.045);
}

.eyebrow,
.inspection-store-filter__title,
.single-store-summary,
.inspection-detail h4,
.overview-metric strong,
.inspection-detail__attachments a,
.inspection-item-attachments__main a,
.template-card__summary::after,
.inspection-card__summary::after {
  color: #4a4d52;
}

.button {
  color: #ffffff;
  background: #c8652a;
  border-color: #c8652a;
  box-shadow: 0 0.25rem 0.65rem rgba(120, 63, 28, 0.13);
}

.button:hover {
  color: #ffffff;
  background: #a94f1d;
  border-color: #a94f1d;
}

.button--secondary {
  color: #3f4247;
  background: #ffffff;
  border-color: var(--brand-primary-200);
  box-shadow: none;
}

.button--secondary:hover {
  color: #743814;
  background: #fbf1e9;
  border-color: #d9a47e;
}

.management-tabs,
.inspection-type-tabs {
  background: #f1f3f5;
  border-color: #dde1e5;
}

.management-tab[aria-selected='true'],
.store-filter-tab[aria-pressed='true'],
.access-user-button[aria-pressed='true'],
.inspection-type-tab[aria-selected='true'] {
  color: #743814;
  background: #ffffff;
  border-color: #d9a47e;
  box-shadow: inset 0 -0.16rem #c8652a;
}

.inspection-type-tab[aria-selected='true'] .count-badge,
.count-badge {
  color: #853500;
  background: var(--brand-purple-50);
  border-color: var(--brand-purple-200);
}

.store-filter-tab,
.selected-store-chip {
  color: #853500;
  background: var(--brand-purple-50);
  border-color: var(--brand-purple-200);
}

.selected-store-chip:hover,
.selected-store-chip:focus-visible {
  background: #ffe1c4;
}

.access-store-option input,
.option-field input,
.inspection-review-decision input,
.inspection-store-option input {
  accent-color: var(--brand-purple);
}

.field input:focus-visible,
.field select:focus-visible,
.field textarea:focus-visible,
.password-visibility:focus-visible,
.management-tab:focus-visible,
.store-filter-tab:focus-visible,
.access-user-button:focus-visible,
.button:focus-visible,
.inspection-detail__comment textarea:focus-visible {
  border-color: #c8652a;
  outline-color: rgba(200, 101, 42, 0.2);
}

.inspection-card {
  border-left-color: #c8652a;
  box-shadow: 0 0.45rem 1.35rem rgba(36, 38, 42, 0.05);
}

.inspection-card:hover {
  border-color: #c4cddd;
  border-left-color: #a94f1d;
  box-shadow: 0 0.65rem 1.6rem rgba(36, 38, 42, 0.075);
}

.inspection-card--overdue,
.template-card--assignment {
  border-left-color: var(--brand-coral);
}

.inspection-card__store,
.store-code-badge,
.store-chip {
  color: #ffffff;
  background: #555b63;
}

.template-card {
  background: #ffffff;
  border-left-color: #c8652a;
  box-shadow: 0 0.45rem 1.4rem rgba(36, 38, 42, 0.055);
}

.template-item,
.store-card,
.user-card,
.version-history__list > li {
  background: #fafafa;
  border-color: var(--border);
}

.version-history__list > li {
  border-left-color: #c8652a;
}

.rich-text-toolbar {
  background: #f3f4f6;
  border-color: var(--brand-primary-200);
}

.combobox-options button:hover,
.combobox-options button:focus-visible,
.combobox-options button[aria-selected='true'] {
  color: var(--brand-primary-950);
  background: var(--brand-primary-50);
}

.inspection-detail__comment-save,
.inspection-remediation-editor__comment-save {
  color: #ffffff;
  background: #c8652a;
  border-color: #c8652a;
}

.inspection-detail__comment-save:hover,
.inspection-remediation-editor__comment-save:hover {
  color: #ffffff;
  background: #a94f1d;
}

.status-badge--active,
.record-state--active {
  color: var(--brand-green-950);
  background: var(--brand-green-50);
  border-color: var(--brand-green-200);
}

.inspection-history-detail__violation {
  background: var(--surface);
  border-color: var(--border);
}

.record-state--overdue,
.inspection-card--overdue .record-state {
  color: #8c4035;
  background: var(--brand-coral-50);
}

.record-state--inactive,
.status-badge--inactive {
  color: #5f6268;
  background: #eceeef;
}
.overview-reviews {
  margin-top: 2rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border-color, #dce1e7);
}

.overview-reviews__list {
  width: 100%;
}

.overview-reviews__tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 1rem;
}

.overview-reviews__tab {
  padding: 0.75rem 1rem;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
  color: var(--text);
  font: inherit;
  cursor: pointer;
}

.overview-reviews__tab[aria-pressed="true"] {
  border-color: var(--brand-orange);
  background: var(--brand-purple-50);
  color: var(--brand-purple);
}

.overview-reviews__tab:focus-visible {
  outline: 2px solid var(--brand-orange);
  outline-offset: 2px;
}

.overview-reviews__card {
  width: 100%;
  max-width: 760px;
  min-width: 0;
  overflow-x: auto;
}

.overview-reviews__card h4 {
  margin: 0 0 0.5rem;
}

.overview-reviews__card iframe {
  display: block;
  width: 100%;
  min-width: 300px;
  height: 600px;
  margin-top: 0.75rem;
  box-sizing: border-box;
  border: 1px solid #dce1e7;
  border-radius: 12px;
  background: #fff;
}

/* Вариант «Действия и нарушения»: одинаковая иерархия во всех разделах. */
.field {
  color: var(--text-muted);
}

.field input,
.field select,
.field textarea,
.rich-text-editor,
.template-description-view,
.overview-filter-multi__trigger,
.overview-metric strong,
.sidebar-nav__count {
  font-weight: var(--font-weight-body);
}

.field input,
.field select,
.field textarea {
  color: var(--text);
  border-color: var(--border);
}

.inspection-comment-field__label,
th,
legend,
.inspection-history-detail__answer > strong,
.inspection-history-photos__violation-comment > strong,
.template-card__expanded-row > strong,
.inspection-review-decision__photos-title {
  font-weight: var(--font-weight-label);
}

.inspection-detail__item > strong,
.inspection-history-photos__heading,
.inspection-review-decision > strong,
.inspection-remediation-editor > strong,
.inspection-ai-analysis > strong,
.inspection-item-attachments__heading > strong,
.inspection-remediation-materials__heading > strong,
.inspection-remediation-photo-pairs__heading > strong,
.inspection-remediation-photo-pair__panel > strong,
.inspection-history-detail__materials-title,
.version-history__heading > strong,
.version-history__changes > strong,
.inspection-violation-description {
  font-weight: var(--font-weight-accent);
}

.sidebar-nav__button[aria-current='page'],
.management-tab[aria-selected='true'],
.store-filter-tab[aria-pressed='true'],
.access-user-button[aria-pressed='true'],
.access-user-button[aria-pressed='true'] strong,
.inspection-type-tab[aria-selected='true'],
.overview-store-mode--active,
.overview-reviews__tab[aria-pressed='true'],
.rich-text-toolbar button {
  font-weight: var(--font-weight-accent);
}

.rich-text-toolbar button strong {
  font-weight: inherit;
}

/* Узкий «Обзор»: заголовок и показатели не сжимают друг друга. */
@media (max-width: 1100px) {
  #session-panel .overview-heading {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    align-items: stretch;
    gap: 1rem;
  }

  #session-panel .overview-metrics {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    justify-content: stretch;
    gap: 0.5rem;
  }

  #session-panel .overview-metric {
    min-width: 0;
    padding: 0.65rem 0.75rem;
    overflow-wrap: anywhere;
  }

  #session-panel .overview-metric--rate {
    grid-column: 1 / -1;
  }
}

@media (max-width: 760px) {
  .auth-card.application-mode,
  .auth-card.application-mode.sidebar-collapsed {
    grid-template-columns: 3.5rem minmax(0, 1fr);
  }

  .app-sidebar {
    overflow-y: auto;
  }

  .sidebar-collapsed .app-sidebar {
    width: 3.5rem;
    padding: 0.3rem;
  }

  .workspace-header,
  #session-panel {
    padding-inline: 0.75rem;
  }

  .application-mode #session-panel {
    margin-top: 0;
  }

  #session-panel .overview-filters {
    grid-template-columns: minmax(0, 1fr);
    gap: 0.75rem;
  }

  #session-panel .field,
  #session-panel .overview-filter-multi {
    width: 100%;
    min-width: 0;
    max-width: 100%;
    margin-top: 0;
  }

  #session-panel .field input,
  #session-panel .overview-filter-multi__dropdown {
    min-width: 0;
    max-width: 100%;
  }

  #session-panel .overview-filter-multi__trigger {
    min-width: 0;
    white-space: normal;
    overflow-wrap: anywhere;
  }

  #session-panel .overview-list-actions > *,
  #session-panel .overview-table td > * {
    min-width: 0;
    max-width: 100%;
    overflow-wrap: anywhere;
  }

  #session-panel .overview-bulk-actions,
  #session-panel .overview-export-actions {
    flex-wrap: wrap;
  }
}

@media (max-width: 480px) {
  #session-panel .overview-table td,
  #session-panel .overview-table__selection-cell {
    grid-template-columns: minmax(0, 1fr);
    gap: 0.35rem;
    padding: 0.65rem 0.75rem;
  }

  #session-panel .overview-table td::before {
    text-transform: none;
    letter-spacing: normal;
  }
}

/* Мобильный вариант «Панель». Настольные фильтры остаются самостоятельными. */
.mobile-navigation,
.mobile-overview-toolbar {
  display: none;
}

.mobile-sheet {
  position: fixed;
  inset: auto 0 var(--mobile-keyboard-offset, 0px);
  width: 100%;
  max-width: 100%;
  max-height: calc(var(--mobile-visible-height, 100dvh) - 12px);
  margin: 0;
  padding: 0;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border);
  border-bottom: 0;
  border-radius: 1.25rem 1.25rem 0 0;
  overflow: hidden;
  font: inherit;
}

.mobile-sheet[open] { display: flex; flex-direction: column; }
.mobile-sheet::backdrop { background: rgba(41, 43, 48, 0.4); }
.mobile-sheet__header,
.mobile-sheet__actions { display: flex; flex-shrink: 0; align-items: center; gap: 0.75rem; padding: 0.85rem 1rem; }
.mobile-sheet__header { justify-content: space-between; border-bottom: 1px solid var(--border); }
.mobile-sheet__header h2 { font-size: 1.15rem; }
.mobile-sheet__close { width: 2.75rem; height: 2.75rem; padding: 0; background: var(--surface); border: 1px solid var(--border); border-radius: 0.7rem; color: var(--text); font-size: 1.6rem; cursor: pointer; }
.mobile-sheet__body { min-height: 0; margin: 0; padding: 1rem; overflow-y: auto; overscroll-behavior: contain; }
.mobile-sheet__actions { padding-bottom: calc(0.85rem + env(safe-area-inset-bottom)); border-top: 1px solid var(--border); }
.mobile-sheet__actions .button { width: auto; min-width: 0; margin: 0; padding-inline: 0.85rem; font-size: 0.9rem; }
.mobile-sheet__actions .button:last-child { flex: 1; }
#mobile-overview-fields { display: grid; gap: 1rem; }
.mobile-filter-group { min-inline-size: 0; margin: 0; padding: 0; border: 0; }
.mobile-filter-group legend { margin-bottom: 0.5rem; color: var(--text-muted); font-size: 0.85rem; }
.mobile-filter-choice { min-width: 0; border: 1px solid var(--border); border-radius: 0.65rem; overflow: hidden; }
.mobile-filter-choice summary { min-height: 3rem; padding: 0.75rem; color: var(--text); cursor: pointer; overflow-wrap: anywhere; }
.mobile-filter-search { display: block; width: calc(100% - 1.5rem); min-width: 0; min-height: 2.75rem; margin: 0 0.75rem 0.5rem; padding: 0.5rem; border: 1px solid var(--border); border-radius: 0.5rem; background: var(--surface); color: var(--text); font: inherit; font-size: 16px; }
.mobile-filter-toggle { display: block; width: 100%; min-height: 2.75rem; padding: 0.65rem 0.75rem; background: var(--brand-purple-50); color: #743814; border: 0; cursor: pointer; text-align: left; font: inherit; font-weight: var(--font-weight-accent); }
.mobile-filter-options { max-height: 15rem; overflow-y: auto; overscroll-behavior: contain; }
.mobile-filter-option { display: flex; min-height: 2.75rem; align-items: center; gap: 0.65rem; padding: 0.65rem 0.75rem; border-top: 1px solid var(--border); overflow-wrap: anywhere; }
.mobile-filter-option input { width: 1.15rem; height: 1.15rem; flex-shrink: 0; accent-color: var(--brand-orange); }
.mobile-filter-empty { margin: 0; padding: 0.75rem; color: var(--text-muted); }
.mobile-filter-date { display: grid; min-width: 0; gap: 0.4rem; margin-top: 0.5rem; color: var(--text-muted); font-size: 0.85rem; }
.mobile-filter-date input { display: block; width: 100%; max-width: 100%; min-width: 0; min-height: 3rem; padding: 0.65rem; color: var(--text); background: var(--surface); border: 1px solid var(--border); border-radius: 0.65rem; font: inherit; font-size: 16px; }
.mobile-filter-modes { display: flex; gap: 0.5rem; margin-bottom: 0.75rem; flex-wrap: wrap; }
.mobile-filter-modes .button { width: auto; margin: 0; min-height: 2.75rem; padding: 0.5rem 0.75rem; font-size: 0.85rem; }
.mobile-filter-modes [aria-pressed='true'] { background: var(--brand-purple-50); border-color: var(--brand-orange); }
.mobile-more { display: grid; gap: 0.3rem; }
.mobile-more__button { display: flex; min-height: 3rem; align-items: center; gap: 0.75rem; width: 100%; padding: 0.75rem; background: var(--surface); color: var(--text); border: 0; border-radius: 0.6rem; text-align: left; font: inherit; cursor: pointer; }
.mobile-more__button[aria-current='page'] { color: #743814; background: var(--brand-purple-50); }
.mobile-more__button svg { width: 1.4rem; height: 1.4rem; fill: none; stroke: currentColor; stroke-width: 1.6; }
.mobile-sheet button:focus-visible,
.mobile-sheet input:focus-visible,
.mobile-sheet summary:focus-visible,
.mobile-navigation button:focus-visible,
.mobile-overview-toolbar button:focus-visible { outline: 2px solid var(--brand-orange); outline-offset: -3px; }

@media (max-width: 760px) {
  body.application-open { --mobile-navigation-space: calc(4.25rem + env(safe-area-inset-bottom)); }
  .application-open .auth-card.application-mode,
  .application-open .auth-card.application-mode.sidebar-collapsed {
    grid-template-columns: minmax(0, 1fr);
    height: calc(100dvh - var(--mobile-navigation-space));
  }
  .application-open .app-sidebar { display: none; }
  .application-open .workspace-header,
  .application-open .workspace-panel,
  .application-open .inspection-detail-screen { grid-column: 1; }
  .application-open .workspace-header { padding-top: max(0.75rem, env(safe-area-inset-top)); }
  .application-open .workspace-panel { margin-top: 0; padding-inline: 0.85rem; }
  .mobile-navigation {
    position: fixed; z-index: 5; bottom: 0; left: 0; right: 0;
    display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr);
    height: var(--mobile-navigation-space); padding: 0.35rem 0.2rem calc(0.35rem + env(safe-area-inset-bottom));
    background: var(--surface); border-top: 1px solid var(--border);
  }
  .mobile-navigation__button { position: relative; display: flex; min-width: 0; min-height: 2.75rem; align-items: center; justify-content: center; flex-direction: column; gap: 0.25rem; padding: 0.25rem 0; background: transparent; border: 0; color: var(--text-muted); font: inherit; font-size: 0.65rem; cursor: pointer; }
  .mobile-navigation__button svg { width: 1.4rem; height: 1.4rem; fill: none; stroke: currentColor; stroke-width: 1.6; }
  .mobile-navigation__button[aria-current='page'] { color: var(--brand-orange); font-weight: var(--font-weight-accent); }
  .mobile-navigation__count { position: absolute; top: 0; right: 0.1rem; min-width: 1rem; padding: 0.05rem 0.2rem; background: var(--brand-orange); color: #fff; border-radius: 1rem; font-size: 0.6rem; font-weight: var(--font-weight-body); }
  .application-open:has(#inspection-detail-screen:not([hidden])) { --mobile-navigation-space: 0px; }
  .application-open:has(#inspection-detail-screen:not([hidden])) .mobile-navigation { display: none; }
  .inspection-detail-screen { padding-top: max(0.85rem, env(safe-area-inset-top)); }
  .mobile-overview-toolbar { display: grid; gap: 0.25rem; margin-bottom: 1rem; }
  .mobile-overview-toolbar__row { display: flex; align-items: stretch; gap: 0.5rem; min-width: 0; }
  .mobile-overview-toolbar button { display: flex; min-height: 2.75rem; align-items: center; gap: 0.5rem; min-width: 0; padding: 0.65rem 0.75rem; background: var(--surface); border: 1px solid var(--border); border-radius: 0.7rem; color: var(--text); font: inherit; font-size: 0.9rem; text-align: left; cursor: pointer; }
  .mobile-overview-toolbar button:disabled { opacity: 0.6; cursor: wait; }
  .mobile-overview-toolbar svg { width: 1.1rem; height: 1.1rem; flex-shrink: 0; fill: none; stroke: currentColor; stroke-width: 1.6; }
  .mobile-overview-toolbar__stores { flex: 1; justify-content: space-between; }
  #mobile-overview-store-label { min-width: 0; overflow-wrap: anywhere; }
  #mobile-overview-single-store { flex: 1; min-width: 0; margin: 0; align-self: center; color: var(--text-muted); font-size: 0.85rem; overflow-wrap: anywhere; }
  .mobile-overview-toolbar .mobile-overview-toolbar__filter { font-weight: var(--font-weight-accent); }
  .mobile-overview-toolbar .mobile-overview-toolbar__filter--active { color: #743814; background: var(--brand-purple-50); border-color: #d9a47e; }
  .mobile-overview-toolbar .mobile-overview-toolbar__period { border: 0; background: transparent; color: var(--text-muted); padding-inline: 0; font-size: 0.8rem; }
  #session-panel .overview-heading > div:first-child,
  #session-panel > .overview-filters,
  #session-panel > .overview-store-filter,
  #session-panel > .single-store-summary { display: none; }
  #session-panel .overview-metric--rate { display: flex; align-items: center; flex-wrap: wrap; gap: 0.5rem; }
  #overview-remediation-rate { min-width: 0; margin-left: auto; font-size: 1rem; overflow-wrap: normal; }
  #session-panel .overview-reviews__card iframe { min-width: 0; max-width: 100%; }
  #session-panel .overview-list-actions { margin-block: 1rem; }
}
