:root {
  color-scheme: light;
  font-family: Arial, Helvetica, sans-serif;
  line-height: 1.45;
  color: #202124;
  background: #f6f7f9;
}

body {
  margin: 0;
}

a {
  color: #0f5c9c;
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

.topbar {
  align-items: center;
  background: #ffffff;
  border-bottom: 1px solid #d8dde6;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  padding: 14px 28px;
}

.brand {
  font-size: 18px;
  font-weight: 700;
  justify-self: start;
}

.topnav {
  display: flex;
  gap: 16px;
  justify-self: center;
}

.logout-link {
  justify-self: end;
}

.topnav a {
  border-bottom: 2px solid transparent;
  padding-bottom: 2px;
  text-decoration: none;
}

.topnav a.active {
  border-bottom: 2px solid #1f6f43;
  font-weight: 700;
}

.topnav a:hover {
  border-bottom: 2px solid #aeb7c2;
  text-decoration: none;
}

.shell {
  margin: 0 auto;
  max-width: min(96vw, 1680px);
  padding: 32px 32px;
}

.panel {
  background: #ffffff;
  border: 1px solid #d8dde6;
  border-radius: 8px;
  padding: 24px;
}

/* Gap between consecutive panels for visual separation.
   Principle: every logical section gets its own .panel with consistent spacing.
   Applies to all pages (contracts, AP, AU, waste-catalog). */
.panel + .panel {
  margin-top: 28px;
}

/* Divider between sub-sections inside the AP Editor panel.
   Gray dashed line separates logical variable groups. */
.ap-editor-divider {
  border: none;
  border-top: 2px dashed #9aa6b5;
  margin: 32px 0;
}

/* Two signatory fields side-by-side inside the AP Editor panel.
   Equal width, wider inputs, no label wrapping, wide gap. */
.signatory-fields-row {
  display: grid;
  grid-template-columns: minmax(360px, 1fr) minmax(360px, 1fr);
  gap: 48px;
}
.signatory-field strong {
  display: block;
  white-space: nowrap;
  margin-bottom: 6px;
}
.signatory-field input {
  width: 100%;
  box-sizing: border-box;
}

.login {
  max-width: 420px;
  margin: 0 auto;
}

.field {
  display: grid;
  gap: 6px;
  margin-bottom: 16px;
}

.date-range {
  display: flex;
  gap: 16px;
  margin-bottom: 16px;
}

.date-range .field {
  flex: 1;
  margin-bottom: 0;
}

.field-checkbox {
  align-items: center;
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
}

.field-checkbox input {
  margin: 0;
  width: auto;
}

input {
  border: 1px solid #aeb7c2;
  border-radius: 6px;
  box-sizing: border-box;
  font-size: 16px;
  padding: 10px 12px;
  width: 100%;
}

select {
  border: 1px solid #aeb7c2;
  border-radius: 6px;
  box-sizing: border-box;
  font-size: 16px;
  padding: 10px 12px;
  width: 100%;
}

button {
  cursor: pointer;
  font-family: inherit;
  font-size: inherit;
}



.error {
  background: #fff1f0;
  border: 1px solid #d93025;
  border-radius: 6px;
  color: #9b1c13;
  margin-bottom: 16px;
  padding: 10px 12px;
}

.notice {
  background: #eef8ef;
  border: 1px solid #79b68f;
  border-radius: 6px;
  color: #1f5b33;
  margin-bottom: 20px;
  padding: 10px 12px;
}

.muted {
  color: #667085;
}

.page-header {
  margin-bottom: 20px;
}

.page-header h1,
.panel h2 {
  margin-top: 0;
}

.split-grid {
  display: grid;
  gap: 20px;
  grid-template-columns: minmax(380px, 1fr) minmax(380px, 1fr);
  margin-bottom: 20px;
}

.filter-grid {
  display: grid;
  gap: 10px;
}

.hint {
  color: #51606f;
  font-size: 14px;
  margin-bottom: 14px;
}

.tag {
  background: #eef2f6;
  border: 1px solid #d8dde6;
  border-radius: 999px;
  display: inline-block;
  margin: 4px 6px 0 0;
  padding: 4px 10px;
}

.match-panel {
  margin-top: 16px;
}

.suggestion-list {
  margin: 12px 0 0;
  padding-left: 20px;
}

/* DEPRECATED: use asterisk-gkno for hazard (black) or required-mark for required (red).
   Kept for backward compatibility in case of stray references. */
.asterisk-mark {
  color: #9b1c13;
  font-weight: 700;
}

.asterisk-gkno {
  color: #000000;
  font-weight: 700;
}

.table-wrap {
  overflow-x: auto;
}

.journal-table {
  border-collapse: collapse;
  width: 100%;
}

.journal-table th,
.journal-table td {
  border-bottom: 1px solid #d8dde6;
  padding: 12px 10px;
  text-align: left;
  vertical-align: top;
}

.journal-table th {
  color: #51606f;
  font-size: 14px;
  font-weight: 700;
}

.journal-table td.numeric,
.journal-table .col-numeric {
  font-variant-numeric: tabular-nums;
}

.empty-state {
  color: #667085;
  text-align: center;
}

.counts {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  justify-items: center;
  margin-top: 20px;
  text-align: center;
}

.count-link {
  display: block;
  text-decoration: none;
  color: inherit;
  width: 100%;
}

.count-link:hover {
  text-decoration: none;
}

.count-link:hover .count {
  border-color: #1f6f43;
  box-shadow: 0 2px 8px rgba(31, 111, 67, 0.15);
}

/* .flow-summary / .review-table spacing now handled by .panel + .panel */

.summary-grid {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.review-table {
  border: 1px solid #d8dde6;
}

/* AU review table column widths */
#au-review-table-wrap .review-table th.col-line { width: 40px; }
#au-review-table-wrap .review-table th.col-unit { width: 65px; }
#au-review-table-wrap .review-table th.col-qty { width: 80px; }
#au-review-table-wrap .review-table th.col-gkno { width: 105px; }
#au-review-table-wrap .review-table td.col-unit,
#au-review-table-wrap .review-table td.col-qty,
#au-review-table-wrap .review-table td.col-gkno { text-align: center; vertical-align: middle; }
#au-review-table-wrap .review-table th.col-hazard { width: 65px; }
#au-review-table-wrap .review-table th.col-method,
#au-review-table-wrap .review-table th.col-method2 { width: 150px; }
#au-review-table-wrap .review-table th.col-actions,
#au-review-table-wrap .review-table td.col-actions { width: 15px; padding: 12px 2px; }
/* override AP's 340px min-width for AU hazard selects — let them fit column */
#au-review-table-wrap .review-form .compact-field select { min-width: 0; }

.review-header {
  align-items: center;
  display: flex;
  gap: 16px;
  justify-content: space-between;
  margin-bottom: 16px;
}

.review-actions {
  display: flex;
  gap: 10px;
  align-items: center;
}

.review-form {
  display: grid;
  gap: 10px;
}

.compact-field {
  margin-bottom: 0;
}

.is-loading { cursor: wait; opacity: 0.7; }
.is-loading::before {
  content: '';
  display: inline-block;
  width: 12px; height: 12px;
  margin-right: 6px;
  border: 2px solid currentColor;
  border-top-color: transparent;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
  vertical-align: middle;
}
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) {
  .is-loading::before { animation: none; }
}

.auto-save-status {
  font-size: 13px;
  font-weight: 500;
  margin-right: 12px;
}
.auto-save-ok { color: #1f6f43; }
.auto-save-error { color: #b3261e; }

.review-form .compact-field select {
  min-width: 340px;
}

.add-row-panel {
  background: #f8fafc;
  border: 1px solid #d8dde6;
  border-radius: 8px;
  margin-bottom: 18px;
  padding: 16px;
}

.add-row-panel h3 {
  margin: 0 0 8px;
}

.add-row-form {
  display: grid;
  gap: 12px;
}

.add-row-search {
  align-items: end;
  display: grid;
  gap: 10px;
  grid-template-columns: minmax(220px, 1fr);
}

.selected-waste {
  background: #ffffff;
  border: 1px solid #d8dde6;
  border-radius: 6px;
  padding: 10px 12px;
}

.catalog-search-results {
  display: grid;
  gap: 6px;
}

.catalog-search-results.live-search-loading,
[data-results-body].live-search-loading {
  opacity: 0.55;
  pointer-events: none;
}

.search-loading-indicator {
  color: #51606f;
  font-size: 13px;
  padding: 8px 12px;
  text-align: center;
  min-height: 18px;
  margin: 0 0 8px 0;
}

.search-loading-indicator[hidden] {
  display: block;
  visibility: hidden;
}

.catalog-search-results.live-search-empty {
  color: #5f6368;
  font-style: italic;
  padding: 4px 2px;
}

.catalog-result-option {
  background: #ffffff;
  border: 1px solid #d8dde6;
  color: #202124;
  text-align: left;
}

.catalog-result-option:hover,
.catalog-result-option.selected {
  background: #e8f0fe;
  border-color: #5d8de8;
}

.suggest-count {
  background: #e8f0fe;
  border-radius: 4px;
  color: #1a73e8;
  font-size: 13px;
  font-weight: 700;
  margin-left: 6px;
  padding: 2px 8px;
}

.count {
  background: #ffffff;
  border: 1px solid #d8dde6;
  border-radius: 8px;
  padding: 24px 16px;
  text-align: center;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.count strong {
  display: block;
  font-size: 26px;
  margin-top: 6px;
}

@media (max-width: 800px) {
  .topbar {
    align-items: flex-start;
    flex-direction: column;
  }

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

  .add-row-search {
    grid-template-columns: 1fr;
  }
}

.export-form {
  margin-top: 12px;
  margin-bottom: 16px;
}

.file-wrap {
  position: relative;
}

.file-wrap input[type="file"] {
  cursor: pointer;
  height: 100%;
  left: 0;
  opacity: 0;
  position: absolute;
  top: 0;
  width: 100%;
}

.file-btn {
  background: #1a1a1a;
  border: 1px solid #1a1a1a;
  border-radius: 6px;
  color: #ffffff;
  cursor: pointer;
  display: inline-block;
  font-size: 16px;
  padding: 10px 14px;
}

.file-btn:hover {
  background: #333333;
  border-color: #333333;
}

.file-name {
  color: #667085;
  margin-left: 10px;
}

.search-highlight {
  background: #fff9c4;
  border-radius: 2px;
  padding: 0 2px;
}

.custom-select {
  position: relative;
  min-width: 340px;
}

.custom-select-trigger {
  align-items: center;
  background: #ffffff;
  border: 1px solid #aeb7c2;
  border-radius: 6px;
  cursor: pointer;
  display: flex;
  font-size: 16px;
  justify-content: space-between;
  padding: 10px 12px;
  user-select: none;
}

.custom-select-trigger:hover {
  border-color: #5a6e82;
}

.custom-select.open .custom-select-trigger {
  border-bottom-left-radius: 0;
  border-bottom-right-radius: 0;
}

.custom-select-placeholder {
  color: #51606f;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.custom-select-placeholder.has-value {
  color: #202124;
}

.custom-select-arrow {
  color: #667085;
  font-size: 12px;
  margin-left: 8px;
  transition: transform 0.15s;
  flex-shrink: 0;
}

.custom-select.open .custom-select-arrow {
  transform: rotate(180deg);
}

.custom-select-options {
  background: #ffffff;
  border: 1px solid #aeb7c2;
  border-top: none;
  border-bottom-left-radius: 6px;
  border-bottom-right-radius: 6px;
  left: 0;
  max-height: 280px;
  overflow-y: auto;
  position: absolute;
  right: 0;
  top: 100%;
  z-index: 100;
  display: none;
}

.custom-select.open .custom-select-options {
  display: block;
}

.custom-select-option {
  cursor: pointer;
  font-size: 15px;
  padding: 9px 12px;
  border-bottom: 1px solid #f0f0f0;
}

.custom-select-option:last-child {
  border-bottom: none;
}

.custom-select-option:hover {
  background: #e8f0fe;
}

.custom-select-option.selected {
  background: #e8f0fe;
  font-weight: 600;
}

.custom-select-disabled .custom-select-trigger {
  background: #f6f7f9;
  color: #a0a8b2;
  cursor: not-allowed;
}

.inline-form {
  align-items: center;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.inline-form input {
  flex: 1;
  min-width: 160px;
}

.inline-form button {
  white-space: nowrap;
  flex-shrink: 0;
}

.stacked-form {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.stacked-form .field {
  width: 100%;
}

.date-input {
  max-width: 140px;
}

.date-row {
  align-items: center;
  display: flex;
  gap: 8px;
}

.date-row > input.date-input {
  flex: 1;
  max-width: none;
}

.parse-warnings {
  background: #fff8e1;
  border: 1px solid #f9a825;
  border-radius: 6px;
  color: #6d4c00;
  margin-bottom: 16px;
  padding: 12px 16px;
}

.parse-warnings strong {
  display: block;
  margin-bottom: 6px;
}

.parse-warnings ul {
  margin: 6px 0 0;
  padding-left: 20px;
}

.parse-warnings li {
  margin-bottom: 4px;
}

.field-missing {
  /* reserved for future validation design */
}

.field-missing-block {
  /* reserved for future validation design */
}

.field-missing-block strong {
  /* reserved for future validation design */
}

.required-mark {
  color: #9b1c13;
  font-weight: 700;
  margin-left: 2px;
}

.field-missing-row > td {
  /* reserved for future validation design */
}

.row-incomplete {
  /* reserved for future validation design */
}

.inline-row-form {
  align-items: center;
  display: flex;
  gap: 6px;
  flex-wrap: nowrap;
  margin-top: 6px;
}

.inline-row-form input[type="text"] {
  flex: 1;
  min-width: 80px;
  padding: 6px 8px;
  font-size: 14px;
}

.inline-row-form select {
  padding: 6px 4px;
  font-size: 14px;
}

.inline-row-form button {
  padding: 6px 10px;
  font-size: 14px;
  white-space: nowrap;
  flex-shrink: 0;
}

.add-row-below-table {
  margin-top: 16px;
}

.bulk-action-bar {
  align-items: center;
  background: #f6f7f9;
  border: 1px solid #d8dde6;
  border-radius: 6px;
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 12px;
  padding: 10px 14px;
}

.bulk-action-summary {
  color: #344054;
  font-size: 14px;
  font-weight: 500;
}

.bulk-action-buttons {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-left: auto;
}

.bulk-action-buttons button {
  font-size: 13px;
  padding: 6px 12px;
}

.bulk-action-buttons button:disabled {
  background: #d8dde6;
  border-color: #d8dde6;
  color: #51606f;
  cursor: not-allowed;
}

.review-col-check {
  text-align: center;
  vertical-align: middle;
  width: 36px;
}

.review-table .review-col-line {
  text-align: center;
  vertical-align: middle;
  width: 48px;
}

.review-col-check input[type="checkbox"] {
  cursor: pointer;
  margin: 0;
}

/* AP review table: unit baseline, qty 1.5× unit, waste fills rest */
#review-table-section .review-table th.col-unit,
#review-table-section .review-table td.col-unit {
  width: 80px;
  vertical-align: middle;
}
#review-table-section .review-table th.col-qty,
#review-table-section .review-table td.col-qty {
  width: 120px;
  vertical-align: middle;
}
#review-table-section .review-table th.col-unit,
#review-table-section .review-table th.col-qty {
  white-space: nowrap;
}

.review-row-actions {
  align-items: center;
  display: flex;
  gap: 8px;
  margin-top: 8px;
}

.review-row-value {
  font-size: 14px;
  font-weight: 500;
}

.flow-actions {
  align-items: center;
  border-top: 1px solid #e0e3e8;
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  margin-top: 14px;
  padding-top: 12px;
}

.flow-actions .muted {
  font-size: 13px;
}

.flow-actions .ap-switch-form,
.flow-actions .ap-flow-form {
  display: inline-block;
  margin: 0;
}

/* z-index utility for Preline hs-overlay modals (z-80 not in default Tailwind) */
.z-80 { z-index: 80; }

/* Draft control bar — persistent top bar when a draft is active.
   Houses "Сброс", "Загрузить новый DOCX", "Создать новый АП".
   Sticks at top during scroll so the user always sees draft actions. */
.draft-bar {
  align-items: center;
  background: #ffffff;
  border: 1px solid #d8dde6;
  border-radius: 8px;
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 20px;
  padding: 12px 24px;
  position: sticky;
  top: 0;
  z-index: 10;
}

.draft-bar .muted {
  font-size: 13px;
  margin-right: 4px;
}

.draft-bar form {
  display: inline-block;
  margin: 0;
}

.headers-inputs {
  display: flex;
  gap: 8px;
  margin-bottom: 8px;
}

.headers-inputs input {
  flex: 1;
  min-width: 100px;
}

body.modal-open {
  overflow: hidden;
}

.modal {
  align-items: flex-start;
  display: flex;
  inset: 0;
  justify-content: center;
  padding: 24px 0 24px 0;
  position: fixed;
  z-index: 1000;
}

.modal.hidden {
  display: none;
}

.modal-backdrop {
  background: rgba(15, 23, 42, 0.45);
  inset: 0;
  position: absolute;
}

.modal-window {
  background: #ffffff;
  border-radius: 10px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.25);
  display: flex;
  flex-direction: column;
  max-height: calc(100vh - 48px);
  max-width: 880px;
  position: relative;
  width: calc(100% - 32px);
}

.modal-header {
  align-items: center;
  border-bottom: 1px solid #d8dde6;
  display: flex;
  justify-content: space-between;
  padding: 16px 20px;
}

.modal-header h2 {
  margin: 0;
}

.modal-close {
  background: transparent;
  border: none;
  color: #51606f;
  cursor: pointer;
  font-size: 26px;
  line-height: 1;
  padding: 0 6px;
}

.modal-close:hover {
  color: #202124;
}

.modal-error {
  background: #fff1f0;
  border-bottom: 1px solid #d93025;
  color: #9b1c13;
  margin: 0;
  padding: 10px 20px;
}

.modal-body {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  gap: 16px;
  min-height: 0;
  overflow-y: auto;
  padding: 18px 20px;
}

.modal-footer {
  border-top: 1px solid #d8dde6;
  display: flex;
  justify-content: flex-end;
  padding: 12px 20px;
}

.modal-block {
  background: #f6f7f9;
  border: 1px solid #d8dde6;
  border-radius: 8px;
  padding: 16px 18px;
}

.modal-block h3 {
  margin: 0 0 10px 0;
}

.modal-search-form {
  align-items: center;
  display: flex;
  gap: 8px;
}

.modal-search-form input {
  flex: 1;
  min-width: 0;
}

.modal-search-form button {
  white-space: nowrap;
}

.modal-empty {
  color: #667085;
  margin: 12px 0 0;
}

.modal-table-wrap {
  margin-top: 12px;
  max-height: min(50vh, 420px);
  min-height: 280px;
  overflow: auto;
  position: relative;
}

.modal-table-wrap.live-search-loading {
  opacity: 0.55;
  pointer-events: none;
}

.modal-results-table {
  border-collapse: collapse;
  table-layout: fixed;
  width: 100%;
}

.modal-results-table th,
.modal-results-table td {
  border-bottom: 1px solid #d8dde6;
  font-size: 14px;
  overflow: hidden;
  padding: 9px 10px;
  text-align: left;
  text-overflow: ellipsis;
  vertical-align: middle;
  white-space: nowrap;
}

.modal-results-table th {
  color: #51606f;
  font-size: 13px;
  font-weight: 700;
}

.modal-col-pick {
  text-align: center;
  width: 36px;
}

.modal-col-number {
  width: 110px;
}

.modal-col-date {
  width: 100px;
}

.modal-col-counterparty {
  width: 28%;
}

.modal-col-subject {
  width: auto;
}

.modal-result-row {
  cursor: pointer;
}

.modal-result-row:hover {
  background: #eef4fb;
}

.modal-result-row.is-selected {
  background: #e8f0fe;
  box-shadow: inset 3px 0 0 #1f6f43;
  font-weight: 600;
}

.modal-result-row:focus {
  outline: 2px solid #1f6f43;
  outline-offset: -2px;
}

.modal-apply-btn {
  margin-top: 12px;
}

.modal-apply-btn[disabled] {
  background: #d8dde6;
  border-color: #d8dde6;
  color: #51606f;
  cursor: not-allowed;
}

.modal-create-form .field {
  margin-bottom: 10px;
}

.modal-window-wide {
  max-width: 1400px;
}

.waste-results-tbody tr.modal-empty-row td {
  text-align: center;
  padding: 18px 8px;
  color: #51606f;
}

.waste-results-table {
  width: 100%;
  table-layout: fixed;
}

.waste-results-table .modal-col-gkno {
  width: 85px;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
  padding-right: 4px;
}

.waste-results-table .modal-col-asterisk {
  width: 20px;
  text-align: center;
  padding-left: 4px;
  padding-right: 4px;
}

.waste-results-table .modal-col-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.waste-results-table .modal-col-group,
.waste-results-table .modal-col-subgroup {
  font-size: 13px;
  color: #51606f;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.waste-result-row {
  cursor: pointer;
}

.waste-result-row:hover,
.waste-result-row:focus,
.waste-result-row:focus-visible {
  background: #f4f7fb;
  outline: 2px solid #1f6f43;
  outline-offset: -2px;
}

.waste-card {
  border: 1px solid #d8dde6;
  border-radius: 6px;
  padding: 8px 10px;
  background: #fbfcfe;
  margin-bottom: 6px;
}

.waste-card-name {
  font-size: 14px;
}

.waste-card-meta {
  font-size: 12px;
  margin-top: 2px;
}

.waste-card-hierarchy {
  font-size: 12px;
  margin-top: 6px;
  border-top: 1px dashed #d8dde6;
  padding-top: 4px;
  color: #51606f;
}

.waste-card-hierarchy strong {
  color: #1d2a3a;
}

.catalog-group {
  margin: 0 0 16px 0;
}

.catalog-group > summary {
  cursor: pointer;
  list-style: none;
  padding: 12px 16px;
  background: #eef2f7;
  border: 1px solid #d8dde6;
  border-radius: 6px;
  font-size: 15px;
  font-weight: 600;
  color: #1d2a3a;
  display: flex;
  align-items: baseline;
  gap: 10px;
}

.catalog-group > summary::-webkit-details-marker {
  display: none;
}

.catalog-group > summary::before {
  content: "▶";
  font-size: 11px;
  color: #51606f;
  transition: transform 0.15s;
}

.catalog-group[open] > summary::before {
  transform: rotate(90deg);
}

.catalog-group > summary .group-code {
  font-weight: 700;
  color: #0a2a66;
  background: #ffffff;
  border: 1px solid #d8dde6;
  border-radius: 4px;
  padding: 2px 6px;
  font-size: 12px;
}

.catalog-group > summary .group-count {
  margin-left: auto;
  font-size: 12px;
  color: #51606f;
  font-weight: 400;
}

.catalog-subgroup {
  margin: 12px 0 12px 24px;
  padding-left: 12px;
  border-left: 2px solid #d8dde6;
}

.catalog-subgroup > summary {
  cursor: pointer;
  list-style: none;
  padding: 8px 12px;
  background: #f8fafc;
  border: 1px solid #e5e9f0;
  border-radius: 4px;
  font-size: 14px;
  font-weight: 500;
  color: #2a3b50;
  display: flex;
  align-items: baseline;
  gap: 8px;
}

.catalog-subgroup > summary::-webkit-details-marker {
  display: none;
}

.catalog-subgroup > summary::before {
  content: "▶";
  font-size: 9px;
  color: #51606f;
  transition: transform 0.15s;
}

.catalog-subgroup[open] > summary::before {
  transform: rotate(90deg);
}

.catalog-subgroup > summary .subgroup-code {
  font-weight: 600;
  color: #0a2a66;
  font-variant-numeric: tabular-nums;
}

.catalog-subgroup > summary .subgroup-count {
  margin-left: auto;
  font-size: 12px;
  color: #51606f;
  font-weight: 400;
}

.catalog-subgroup > table.journal-table {
  margin-top: 8px;
  width: calc(100% - 8px);
}

.catalog-no-subgroup > summary {
  background: #faf3e0;
  color: #7a4a08;
}

.filter-grid select {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid #d8dde6;
  border-radius: 4px;
  font-size: 14px;
  background: #ffffff;
  color: #1d2a3a;
}

.filter-grid select:focus {
  outline: 2px solid #2c5fa0;
  outline-offset: -1px;
}

.filter-grid option {
  font-size: 14px;
  padding: 4px;
}

/* ── Pagination ── */

.pagination-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  padding: 14px 0 4px 0;
  margin-top: 4px;
  border-top: 1px solid #e5e8ec;
}

.pagination-info {
  font-size: 13px;
  color: #51606f;
  white-space: nowrap;
}

.pagination-buttons {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
}

.pagination-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 34px;
  height: 34px;
  padding: 0 8px;
  border: 1px solid #2563eb;
  border-radius: 5px;
  background: #ffffff;
  color: #2563eb;
  font-size: 13px;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
  white-space: nowrap;
}

.pagination-btn:hover {
  background: #eff6ff;
  border-color: #1d4ed8;
  color: #1d4ed8;
}

.pagination-btn.active {
  background: #2563eb;
  border-color: #2563eb;
  color: #ffffff;
  font-weight: 600;
  cursor: default;
}

.pagination-btn.disabled {
  color: #aeb7c2;
  border-color: #e5e8ec;
  background: #f9fafb;
  cursor: default;
  pointer-events: none;
}

.pagination-ellipsis {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 34px;
  height: 34px;
  font-size: 13px;
  color: #51606f;
}
