.hk-logo {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.hk-logo__wordmark {
  font-family: 'InfiniteJustice', Inter, "Segoe UI", Arial, sans-serif;
  font-size: 32px;
  letter-spacing: 0.03em;
  line-height: 1;
  color: var(--hk-primary);
}

.hk-logo__sub {
  color: var(--hk-text-muted);
  font-size: var(--hk-font-size-sm);
}

.hk-nav__link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  margin-bottom: 4px;
  border-radius: var(--hk-radius-md);
  color: var(--hk-text);
}

.hk-nav__link:hover {
  background: var(--hk-surface-alt);
  color: var(--hk-text);
}

.hk-nav__link.active {
  background: var(--hk-primary-soft);
  color: var(--hk-primary);
  font-weight: 600;
}

.hk-user-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--hk-border);
  border-radius: var(--hk-radius-md);
  background: var(--hk-surface-alt);
}

.hk-user-card__avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--hk-primary-soft);
  color: var(--hk-primary);
  font-weight: 700;
}

.hk-user-card__name {
  font-weight: 600;
}

.hk-user-card__role {
  color: var(--hk-text-muted);
  font-size: var(--hk-font-size-sm);
}

.hk-icon-btn {
  width: 40px;
  height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--hk-border);
  background: var(--hk-surface);
}

.hk-btn-primary {
  background: var(--hk-primary);
  border-color: var(--hk-primary);
}

.hk-btn-primary:hover,
.hk-btn-primary:focus {
  background: var(--hk-primary-hover);
  border-color: var(--hk-primary-hover);
}

.hk-dot {
  width: 8px;
  height: 8px;
  background: var(--hk-danger);
  border-radius: 50%;
  position: absolute;
  top: 8px;
  right: 10px;
}

.hk-search {
  min-width: 280px;
  display: flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--hk-border);
  border-radius: var(--hk-radius-md);
  background: var(--hk-surface-alt);
  padding: 0 12px;
}

.hk-card {
  background: var(--hk-surface);
  border: 1px solid var(--hk-border);
  border-radius: var(--hk-radius-lg);
  box-shadow: var(--hk-shadow-sm);
}

.hk-card-header,
.hk-card-body,
.hk-card-footer {
  padding: 20px;
}

.hk-card-header {
  border-bottom: 1px solid var(--hk-border);
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
}

.hk-section-title {
  font-size: var(--hk-font-size-lg);
  margin-bottom: 4px;
}

.hk-section-subtitle {
  color: var(--hk-text-muted);
  font-size: var(--hk-font-size-sm);
  margin: 0;
}

.hk-stat-card {
  padding: 20px;
}

.hk-stat-card__icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--hk-primary-soft);
  color: var(--hk-primary);
  margin-bottom: 14px;
}

.hk-stat-card__label {
  color: var(--hk-text-muted);
  font-size: var(--hk-font-size-sm);
  margin-bottom: 6px;
}

.hk-stat-card__value {
  font-size: 30px;
  font-weight: 700;
  line-height: 1.1;
  margin-bottom: 6px;
}

.hk-status {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: var(--hk-font-size-sm);
  font-weight: 600;
}

.hk-status--success { background: var(--hk-success-soft); color: var(--hk-success); }
.hk-status--warning { background: var(--hk-warning-soft); color: #9a6700; }
.hk-status--danger { background: var(--hk-danger-soft); color: var(--hk-danger); }
.hk-status--info { background: var(--hk-info-soft); color: #087990; }

.hk-filter-panel {
  padding: 16px;
  background: var(--hk-surface-alt);
  border: 1px solid var(--hk-border);
  border-radius: var(--hk-radius-md);
}

.hk-table-wrap {
  border: 1px solid var(--hk-border);
  border-radius: var(--hk-radius-md);
  overflow: hidden;
}

.hk-table thead th {
  background: var(--hk-surface-alt);
  color: var(--hk-text-muted);
  font-size: var(--hk-font-size-sm);
  font-weight: 700;
  border-bottom: 1px solid var(--hk-border);
  white-space: nowrap;
}

.hk-table th,
.hk-table td {
  padding: 14px 16px;
}

.hk-table tbody tr:hover {
  background: #fbfdff;
}

.hk-info-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.hk-info-grid--full {
  grid-template-columns: repeat(1, minmax(0, 1fr));
}

.hk-info-grid div {
  padding: 14px 16px;
  border: 1px solid var(--hk-border);
  border-radius: var(--hk-radius-md);
  background: var(--hk-surface-alt);
}

.hk-info-grid span {
  display: block;
  color: var(--hk-text-muted);
  font-size: var(--hk-font-size-sm);
  margin-bottom: 4px;
}

.hk-info-grid strong {
  font-size: var(--hk-font-size-base);
}

.hk-tabs {
  border-bottom-color: var(--hk-border);
  gap: 6px;
}

.hk-tabs .nav-link {
  border: 0;
  border-radius: 10px 10px 0 0;
  color: var(--hk-text-muted);
  font-weight: 600;
}

.hk-tabs .nav-link.active {
  color: var(--hk-primary);
  background: var(--hk-primary-soft);
}

.hk-empty-state {
  border: 1px dashed var(--hk-border-strong);
  border-radius: var(--hk-radius-md);
  padding: 28px;
  text-align: center;
  color: var(--hk-text-muted);
}

.hk-empty-state i {
  font-size: 36px;
  display: block;
  margin-bottom: 10px;
  color: var(--hk-text-soft);
}

.hk-timeline {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.hk-timeline__item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.hk-timeline__dot {
  width: 12px;
  height: 12px;
  margin-top: 5px;
  border-radius: 50%;
  background: var(--hk-primary);
  flex: 0 0 auto;
}

.hk-modal {
  border: 1px solid var(--hk-border);
  border-radius: var(--hk-radius-lg);
}

@media (max-width: 767.98px) {
  .hk-card-header,
  .hk-card-body,
  .hk-card-footer {
    padding: 16px;
  }

  .hk-info-grid {
    grid-template-columns: 1fr;
  }
}
.hk-user-card--stack {
  display: block;
  width: 100%;
  padding: 12px;
  box-sizing: border-box;
}

.hk-user-card--stack .hk-user-card__label {
  margin: 0 0 4px;
  color: var(--hk-text-muted);
  font-size: var(--hk-font-size-sm);
  line-height: 1.2;
}

.hk-user-card--stack .hk-user-card__name {
  margin: 0 0 4px;
  font-weight: 700;
  line-height: 1.3;
  color: var(--hk-text);
  word-break: break-word;
  overflow-wrap: anywhere;
}

.hk-user-card--stack .hk-user-card__org {
  margin: 0 0 10px;
  color: var(--hk-text-muted);
  font-size: var(--hk-font-size-sm);
  line-height: 1.3;
  word-break: break-word;
  overflow-wrap: anywhere;
}

.hk-user-card--stack .hk-user-card__logout {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 36px;
  margin-top: 0;
}

.hk-sidebar__footer .hk-user-card--stack {
  margin-top: 12px !important;
}
/* Stage UX: table actions and alignment */
.hk-table,
.table {
  line-height: 1.35;
}

.hk-table td,
.table td,
.hk-table th,
.table th {
  vertical-align: middle;
}

.table .text-nowrap .d-flex,
.table .text-nowrap .d-inline-flex,
.table td .d-flex.flex-wrap,
.table td .d-inline-flex.flex-wrap {
  align-items: center;
  row-gap: 8px;
}

.table td form.d-inline,
.table td form.d-inline-block {
  display: inline-flex;
}

.table td .btn,
.hk-card .btn,
.hk-page-actions .btn {
  min-width: 72px;
}

.table td .btn-sm,
.hk-card .btn-sm {
  min-width: 74px;
}

.table td .btn + .btn,
.table td form + form,
.table td form + .btn,
.table td .btn + form {
  margin-left: 0;
}

.badge,
.hk-status {
  line-height: 1.15;
}

/* NEKCO v0.3.50 — стабильная панель умного поиска.
   Desktop/tablet: поле и действия всегда в одну строку.
   Mobile: поле сверху, действия компактно ниже. */
.hk-smart-search-card {
  overflow: visible;
}

.hk-smart-search-card .hk-card-body {
  padding: 12px 14px !important;
}

.hk-smart-search-form {
  width: 100%;
  margin: 0;
}

.hk-smart-search-bar {
  display: grid !important;
  grid-template-columns: minmax(260px, 1fr) auto auto auto;
  align-items: center !important;
  gap: 8px;
  width: 100%;
}

.hk-smart-search-field {
  position: relative;
  min-width: 0;
  width: 100%;
  height: 42px;
  display: grid !important;
  grid-template-columns: 40px minmax(0, 1fr);
  align-items: center;
  overflow: hidden;
  border: 1px solid #cfd9e6;
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 1px 2px rgba(15, 23, 42, .02);
  transition: border-color .16s ease, box-shadow .16s ease;
}

.hk-smart-search-field:hover {
  border-color: #b9c8d9;
}

.hk-smart-search-field:focus-within {
  border-color: #7faed8;
  box-shadow: 0 0 0 3px rgba(31, 78, 121, .08);
}

.hk-smart-search-icon {
  width: 40px;
  height: 40px;
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  margin: 0 !important;
  color: #54708d;
  font-size: 15px;
  line-height: 1;
}

.hk-smart-search-field .form-control {
  display: block !important;
  width: 100% !important;
  min-width: 0 !important;
  height: 40px !important;
  min-height: 40px !important;
  margin: 0 !important;
  padding: 0 12px 0 0 !important;
  border: 0 !important;
  border-radius: 0 !important;
  outline: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  color: #172033 !important;
  font-size: 13px;
  line-height: 40px;
}

.hk-smart-search-field .form-control:focus {
  border: 0 !important;
  outline: 0 !important;
  box-shadow: none !important;
}

.hk-smart-search-field .form-control::placeholder {
  color: #8593a4;
  opacity: 1;
}

.hk-smart-search-submit,
.hk-smart-search-filter-btn,
.hk-smart-search-reset {
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-width: 0 !important;
  width: auto !important;
  height: 42px !important;
  min-height: 42px !important;
  margin: 0 !important;
  padding: 0 14px !important;
  border-radius: 10px !important;
  white-space: nowrap;
  line-height: 1 !important;
}

.hk-smart-search-submit i,
.hk-smart-search-filter-btn i,
.hk-smart-search-reset i {
  margin: 0 !important;
  line-height: 1;
}

.hk-smart-search-filter-btn {
  border-color: #cbd7e4 !important;
  background: #fff !important;
  color: #334155 !important;
}

.hk-smart-search-filter-btn:hover,
.hk-smart-search-filter-btn[aria-expanded="true"] {
  border-color: #9fb6cd !important;
  background: #f4f8fc !important;
  color: var(--hk-primary) !important;
}

.hk-smart-search-reset {
  border-color: #d7e0ea !important;
  background: #f8fafc !important;
  color: #64748b !important;
  text-decoration: none !important;
}

.hk-smart-search-reset:hover {
  background: #eef3f8 !important;
  color: #334155 !important;
}

.hk-smart-search-count {
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: var(--hk-primary-soft);
  color: var(--hk-primary);
  font-size: 10px;
  font-weight: 800;
  line-height: 1;
}

.hk-smart-search-panel {
  margin-top: 10px;
  padding: 14px 15px 15px;
  border: 1px solid #e2e9f1;
  border-radius: 10px;
  background: #f8fafc;
}

.hk-smart-search-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
  color: #334155;
  font-size: 13px;
}

.hk-smart-search-panel-head > div {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.hk-smart-search-panel-head i {
  color: var(--hk-primary);
}

.hk-smart-search-panel-head > span {
  padding: 3px 8px;
  border-radius: 999px;
  background: #fff;
  border: 1px solid #dbe4ee;
  color: #64748b;
  font-size: 10px;
  font-weight: 700;
}

.hk-smart-search-panel .form-label {
  font-size: 12px !important;
  margin-bottom: 5px !important;
}

.hk-smart-search-panel .form-control,
.hk-smart-search-panel .form-select {
  background-color: #fff !important;
}

/* Карта: боковая панель по определению уже, поэтому поле занимает всю ширину. */
.hk-smart-search-bar--map {
  grid-template-columns: 1fr auto auto !important;
}

.hk-smart-search-bar--map .hk-smart-search-field {
  grid-column: 1 / -1;
}

.hk-smart-search-panel--map {
  padding: 13px;
}

/* Телефон: только здесь переносим действия. На планшете/небольшом окне
   панель остаётся одной строкой и не «съезжает». */
@media (max-width: 639.98px) {
  .hk-smart-search-card .hk-card-body {
    padding: 10px !important;
  }

  .hk-smart-search-bar {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) !important;
    gap: 7px;
  }

  .hk-smart-search-field {
    grid-column: 1 / -1;
    height: 42px;
  }

  .hk-smart-search-submit,
  .hk-smart-search-filter-btn {
    width: 100% !important;
  }

  .hk-smart-search-reset {
    grid-column: 1 / -1;
    width: 100% !important;
  }

  .hk-smart-search-bar--map {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) !important;
  }

  .hk-smart-search-panel {
    margin-top: 8px;
    padding: 12px;
  }
}


/* HEKCO v0359: native sidebar expandable groups.
 * Uses HTML <details>/<summary>, so the main menu does not depend on Bootstrap JS. */
.hk-nav__details {
  display: block;
  margin: 0;
  padding: 0;
}
.hk-nav__details > summary.hk-nav__link {
  width: 100%;
  cursor: pointer;
  list-style: none;
  user-select: none;
}
.hk-nav__details > summary.hk-nav__link::-webkit-details-marker {
  display: none;
}
.hk-nav__details > summary.hk-nav__link::marker {
  content: "";
}
.hk-nav__details > summary.hk-nav__link .bi-chevron-down {
  transition: transform .18s ease;
}
.hk-nav__details[open] > summary.hk-nav__link .bi-chevron-down {
  transform: rotate(180deg);
}
.hk-nav__submenu {
  display: block;
}

/* HEKCO v0360.7 — registry interaction states (local, no runtime style injection). */
[data-hk-registry-row="1"].hk-registry-row-dblclick-ready { cursor: pointer; transition: background-color .14s ease, box-shadow .14s ease; }
[data-hk-registry-row="1"].hk-registry-row-dblclick-ready:hover { background: rgba(26,95,180,.045) !important; }
[data-hk-registry-row="1"].hk-registry-row-selected { background: rgba(26,95,180,.11) !important; box-shadow: inset 4px 0 0 #1a5fb4; }
[data-hk-registry-row="1"].hk-registry-row-selected > td { background: transparent !important; }
