.ops {
  display: grid;
  gap: 20px;
  min-width: 0;
}

.ops-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 20px;
  padding-block: 7px 5px;
}

.ops-heading h1 {
  margin: 0 0 6px;
  letter-spacing: -.052em;
}

.ops-heading p {
  max-width: 55ch;
  color: var(--muted);
  line-height: 1.6;
}

.ops-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.ops-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 36px;
  padding: 7px 12px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: var(--raised);
  color: var(--ink);
  font-family: inherit;
  font-size: 13px;
  font-weight: 650;
  line-height: 1.35;
  text-decoration: none;
  white-space: nowrap;
  transition: background .16s, border-color .16s, color .16s;
}

.ops-btn:hover {
  background: color-mix(in srgb, var(--primary) 10%, var(--raised));
  border-color: color-mix(in srgb, var(--primary) 52%, var(--line-strong));
  color: var(--ink);
}

.ops-btn:disabled { opacity: .52; cursor: wait; }

.ops-btn:focus-visible, .ops-input:focus-visible,
.ops-provider-option:focus-visible, .ops-tabs a:focus-visible {
  outline: none;
  box-shadow: var(--focus);
}

.ops-primary {
  background: var(--primary);
  border-color: var(--primary);
  color: var(--primary-ink);
}

.ops-primary:hover {
  background: var(--primary-dark);
  border-color: var(--primary-dark);
  color: var(--primary-ink);
}

.ops-danger, .ops-danger:hover { color: var(--red); }
.ops-danger:hover { border-color: var(--red); }

.ops-pane {
  min-width: 0;
  padding: 19px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.ops-pane h2, .ops-pane h3 { margin: 0 0 12px; }
.ops-pane > .ops-form-row > h2 { margin: 0; }
.ops-pane > .ops-form-row { margin-bottom: 14px; }
.ops-pane > p, .ops-note { color: var(--muted); line-height: 1.55; font-size: 13px; }
.ops-pane > p:not(:last-child) { margin-bottom: 14px; }
.ops-pane > .ops-table-wrap + p { margin-top: 14px; }

.ops-grid, .ops-grid-wide { display: grid; gap: 14px; }
.ops-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.ops-grid-wide { grid-template-columns: repeat(3, minmax(0, 1fr)); }

.ops-form {
  display: grid;
  min-width: 0;
  gap: 15px;
}

.ops-form label, .ops-field {
  display: grid;
  min-width: 0;
  align-content: start;
  gap: 6px;
  color: var(--ink);
  font-weight: 600;
  font-size: 13px;
}

.ops-field small, .ops-form label small {
  color: var(--muted);
  font-weight: 400;
  font-size: 12px;
  line-height: 1.5;
}

.ops-input {
  width: 100%;
  min-width: 0;
  min-height: 39px;
  padding: 8px 10px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: var(--input);
  color: var(--ink);
  font: inherit;
  font-size: 13px;
  font-weight: 500;
}

.ops-input::placeholder { color: var(--faint); }
.ops-input[type=checkbox] { width: 16px; min-height: 16px; accent-color: var(--primary); }
.ops-input[readonly] { background: var(--rail); color: var(--muted); }
.ops-input::file-selector-button {
  margin-right: 8px;
  padding: 4px 8px;
  border: 1px solid var(--line-strong);
  border-radius: 5px;
  background: var(--raised);
  color: var(--ink);
  cursor: pointer;
}

textarea.ops-input { resize: vertical; min-height: 84px; }
.ops-span-2 { grid-column: 1/-1; }
.ops-checkboxes { display: flex; flex-wrap: wrap; gap: 10px 16px; }
.ops-checkboxes label, .ops-form .ops-inline-check { display: flex; flex-direction: row; align-items: center; gap: 8px; }

.ops-table-wrap {
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 10px;
  scrollbar-width: thin;
  scrollbar-color: var(--line-strong) transparent;
}

.ops-table {
  width: 100%;
  min-width: 555px;
  border-collapse: collapse;
  text-align: left;
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}

.ops-table thead { background: var(--rail); color: var(--muted); }
.ops-table th, .ops-table td { padding: 12px 15px; vertical-align: middle; }
.ops-table th { font-size: 11px; font-weight: 650; letter-spacing: .018em; white-space: nowrap; }
.ops-table tbody tr { border-top: 1px solid var(--line); transition: background .16s; }
.ops-table tbody tr:hover, .ops-table tbody tr:focus-within {
  background: color-mix(in srgb, var(--primary) 5%, var(--surface));
}

.ops-table td:last-child:has(.ops-btn) { width: 1%; white-space: nowrap; }
.ops-table .ops-btn { min-height: 32px; padding: 5px 9px; font-size: 12px; }
.ops-cell-title { font-weight: 650; color: var(--ink); }
.ops-cell-sub { display: block; margin-top: 2px; color: var(--muted); font-size: 12px; }

.ops-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  max-width: 100%;
  padding: 4px 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--raised);
  color: var(--muted);
  font-size: 11px;
  font-weight: 650;
  line-height: 1.25;
  white-space: nowrap;
}

.ops-badge[data-tone]::before {
  content: '';
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: currentColor;
}

.ops-badge[data-tone=good] { background: var(--green-bg); color: var(--green); }
.ops-badge[data-tone=warn] { background: var(--amber-bg); color: var(--amber); }
.ops-badge[data-tone=bad] { background: var(--red-bg); color: var(--red); }
.ops-badge[data-tone=info] { background: var(--accent-bg); color: var(--accent); }

.ops-empty {
  margin: 0;
  padding: 34px 16px;
  text-align: center;
  color: var(--muted);
  font-size: 13px;
  background: var(--input);
  border: 1px dashed var(--line-strong);
  border-radius: 10px;
}

.ops-metrics { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.ops-stat {
  display: grid;
  align-content: space-between;
  gap: 11px;
  border-top-color: color-mix(in srgb, var(--primary) 48%, var(--line));
}

.ops-stat > span { color: var(--muted); font-size: 12px; font-weight: 600; }
.ops-value {
  color: var(--ink);
  font-size: clamp(25px, 2.6vw, 37px);
  font-weight: 650;
  line-height: 1.1;
  letter-spacing: -.05em;
  font-variant-numeric: tabular-nums;
}

.ops-error, .ops-help {
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  font-size: 13px;
  line-height: 1.5;
}

.ops-error { background: var(--red-bg); color: var(--red); }
.ops-help { background: var(--accent-bg); color: var(--accent); }

.ops-line {
  display: grid;
  grid-template-columns: minmax(130px, 1.5fr) minmax(64px, .4fr) minmax(100px, 1fr) auto;
  gap: 9px;
  align-items: end;
  padding: 11px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--rail);
}

.ops-line + .ops-line { margin-top: 8px; }
.ops-order-line { grid-template-columns: minmax(100px, 1.15fr) minmax(74px, .65fr) minmax(100px, 1fr) minmax(100px, 1fr); }

.ops-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 14px;
  border-bottom: 1px solid var(--line);
}

.ops-tabs a {
  margin-bottom: -1px;
  padding: 4px 2px 10px;
  border-bottom: 2px solid transparent;
  color: var(--muted);
  font-size: 13px;
  font-weight: 650;
  text-decoration: none;
}

.ops-tabs a:hover { color: var(--ink); }
.ops-tabs a[aria-current=page] { border-color: var(--primary); color: var(--primary); }
.ops-detail { display: grid; gap: 14px; }
.ops-detail > section { padding-top: 13px; border-top: 1px solid var(--line); }

.ops-dialog {
  width: min(770px, calc(100% - 26px));
  max-height: calc(100dvh - 36px);
  padding: 0;
  overflow: auto;
  border: 1px solid var(--line-strong);
  border-radius: calc(var(--radius) + 3px);
  background: var(--surface);
  box-shadow: 0 22px 75px #000b;
  color: var(--ink);
}

.ops-dialog::backdrop { background: #0b0813bd; backdrop-filter: blur(4px); }
.ops-dialog-body { padding: 20px; }
.ops-dialog-head {
  position: sticky;
  top: 0;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 15px 20px;
  border-bottom: 1px solid var(--line);
  background: var(--surface);
}
.ops-dialog-head h2 { margin: 0; font-size: 19px; }
.ops-dialog-body [data-catalog-result]:not(:empty) { display: grid; gap: 10px; margin-top: 18px; }

.ops-sheet-list { display: grid; gap: 8px; }
.ops-sheet-item {
  display: grid;
  gap: 5px;
  padding: 11px 13px;
  overflow-wrap: anywhere;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--input);
}

.ops-inline-form { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: end; gap: 10px; }
.ops-muted { color: var(--muted); }
.ops-copy { white-space: pre-wrap; color: var(--muted); line-height: 1.55; }
.ops-bar { height: 5px; margin-top: 8px; overflow: hidden; border-radius: 999px; background: var(--raised); }
.ops-bar span { display: block; height: 100%; border-radius: inherit; background: var(--chart-fill, var(--primary)); }
.ops-report-charts { align-items: start; }
.ops-report-charts [data-chart-style=team] { --chart-fill: var(--accent); }
.ops-report-charts [data-chart-style=segment] { --chart-fill: var(--green); }
.ops-distribution { display: grid; gap: 14px; margin: 16px 0 0; padding: 0; list-style: none; }
.ops-distribution-value { display: inline-flex; align-items: baseline; gap: 9px; font-variant-numeric: tabular-nums; }
.ops-distribution-value small { min-width: 3ch; color: var(--muted); text-align: right; }
.ops-form-row { display: flex; justify-content: space-between; flex-wrap: wrap; align-items: center; gap: 9px; }
.ops-upload { padding: 14px; border: 1px dashed var(--line-strong); border-radius: 9px; background: var(--input); }
.ops-filters { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.ops-filters .ops-input { width: auto; min-width: 130px; max-width: 100%; }
.ops-form details summary { cursor: pointer; font-size: 13px; font-weight: 650; color: var(--accent); }

.ops-provider-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 11px;
}

.ops-provider-option {
  display: flex;
  align-items: center;
  gap: 11px;
  min-width: 0;
  min-height: 75px;
  padding: 12px 14px;
  text-align: left;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--ink);
  transition: border-color .16s, background .16s;
}

.ops-provider-option:hover { border-color: var(--line-strong); }
.ops-provider-option[aria-pressed=true] {
  border-color: color-mix(in srgb, var(--primary) 57%, var(--line));
  background: color-mix(in srgb, var(--primary) 10%, var(--surface));
}

.ops-provider-mark, .ops-provider-chip {
  display: inline-grid;
  flex: none;
  place-items: center;
  border: 1px solid color-mix(in srgb, currentColor 24%, transparent);
  background: color-mix(in srgb, currentColor 11%, transparent);
  color: var(--primary);
  font-size: 15px;
  font-weight: 750;
  line-height: 1;
  letter-spacing: -.04em;
}

.ops-provider-mark { width: 38px; height: 38px; border-radius: 10px; }
.ops-provider-chip { width: 31px; height: 28px; border-radius: 7px; font-size: 12px; }
.ops-provider-mark[data-provider-mark=du], .ops-provider-chip[data-provider-mark=du] { color: #8fdcf4; }
.ops-provider-mark[data-provider-mark="e&"], .ops-provider-chip[data-provider-mark="e&"] { color: #f7a5bf; }
.ops-provider-copy { display: grid; flex: 1; min-width: 0; }
.ops-provider-copy strong { font-size: 14px; font-weight: 650; }
.ops-provider-copy small { color: var(--muted); font-size: 11px; }
.ops-provider-total { color: var(--ink); font-size: 23px; font-weight: 650; letter-spacing: -.055em; font-variant-numeric: tabular-nums; }
.ops-provider-option[aria-pressed=true] .ops-provider-total { color: var(--primary); }

.ops-catalog { padding: 0; overflow: hidden; }
.ops-catalog-tools {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 10px 16px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
}
.ops-catalog-tools h2, .ops-catalog-tools .ops-filters { margin: 0; }
.ops-catalog-search { position: relative; max-width: 100%; }
.ops-catalog-search .icon { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); width: 16px; height: 16px; color: var(--muted); pointer-events: none; }
.ops-catalog-search .ops-input { width: min(230px, 100%); padding-left: 34px; }
.ops-catalog .ops-table-wrap { border: 0; border-radius: 0; }
.ops-catalog .ops-catalog-table { min-width: 655px; }
.ops-catalog .ops-empty { margin: 14px; }
.ops-price .ops-cell-title { font-variant-numeric: tabular-nums; white-space: nowrap; }
.ops-catalog > .ops-catalog-count { padding: 10px 15px; border-top: 1px solid var(--line); font-size: 12px; color: var(--muted); }
.ops-schedule-filter { width: auto; }
.ops-deadline { white-space: nowrap; }

@media (max-width: 1080px) {
  .ops-metrics { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .ops-provider-copy small { display: none; }
}

@media (max-width: 900px) {
  .ops-grid-wide:not(.ops-metrics) { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ops-line, .ops-order-line { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ops-line:not(.ops-order-line) label:first-child { grid-column: 1/-1; }
}

@media (max-width: 770px) {
  .ops-heading { align-items: start; flex-direction: column; gap: 13px; }
  .ops-pane { padding: 14px; }
  .ops-catalog { padding: 0; }
  .ops-provider-copy small { display: block; }
}

@media (max-width: 590px) {
  .ops { gap: 14px; }
  .ops-grid, .ops-grid-wide:not(.ops-metrics) { grid-template-columns: minmax(0, 1fr); }
  .ops-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ops-dialog-body, .ops-dialog-head { padding: 13px; }
  .ops-line, .ops-order-line { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ops-inline-form { grid-template-columns: minmax(0, 1fr); }
  .ops-provider-list { gap: 6px; }
  .ops-provider-option { display: grid; grid-template-columns: 1fr auto; gap: 5px 6px; min-height: 70px; padding: 9px; }
  .ops-provider-mark { width: 28px; height: 28px; border-radius: 7px; font-size: 12px; }
  .ops-provider-mark .icon { width: 15px; height: 15px; }
  .ops-provider-copy { grid-row: 2; grid-column: 1/-1; }
  .ops-provider-copy strong { font-size: 12px; }
  .ops-provider-copy small { display: none; }
  .ops-provider-total { font-size: 19px; }
  .ops-catalog-tools { padding: 12px; }
  .ops-catalog-tools .ops-filters { display: grid; grid-template-columns: minmax(0, 1fr) minmax(102px, .8fr); width: 100%; }
  .ops-catalog-tools .ops-input { width: 100%; min-width: 0; }
  .ops-table th, .ops-table td { padding: 10px 12px; }
}

@media (pointer: coarse) {
  .ops-btn, .ops-table .ops-btn, .ops-input { min-height: 44px; }
  .ops-input[type=checkbox] { min-height: 16px; }
}
