/* PC UI refinement layer: forms, dialogs, metric drill-down and precise alignment. */
.hx-admin-v2 {
  --hx-control-height: 40px;
  --hx-body-line: 22px;
  --hx-label-line: 20px;
}

.hx-admin-v2,
.hx-admin-v2 input,
.hx-admin-v2 select,
.hx-admin-v2 textarea,
.hx-admin-v2 button {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", Arial, sans-serif;
}

.hx-admin-v2 p,
.hx-admin-v2 td,
.hx-admin-v2 .hint-text {
  line-height: var(--hx-body-line);
}

.hx-admin-v2 .btn,
.hx-admin-v2 .row-action-btn,
.hx-admin-v2 .save-btn-inline {
  min-height: var(--hx-control-height);
  padding: 0 14px;
  border-radius: 9px;
  font-size: 14px;
  line-height: 20px;
}

.hx-admin-v2 .btn-sm,
.hx-admin-v2 .property-group-actions .row-action-btn,
.hx-admin-v2 .save-btn-inline {
  min-height: 32px;
  height: 32px;
  padding: 0 11px;
  font-size: 13px;
}

.hx-admin-v2 button:focus-visible,
.hx-admin-v2 input:focus-visible,
.hx-admin-v2 select:focus-visible,
.hx-admin-v2 textarea:focus-visible,
.hx-admin-v2 [role="button"]:focus-visible {
  outline: 3px solid rgba(0, 158, 255, 0.2);
  outline-offset: 2px;
}

.hx-admin-v2 button:disabled,
.hx-admin-v2 input:disabled,
.hx-admin-v2 select:disabled,
.hx-admin-v2 textarea:disabled {
  cursor: not-allowed;
  opacity: 0.58;
}

.hx-quick-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  padding: 14px;
}

.hx-workbench-grid {
  grid-template-columns: minmax(0, 1fr) minmax(500px, 0.95fr);
}

.hx-quick-grid .hx-quick-action {
  grid-template-columns: 40px minmax(0, 1fr);
  min-height: 82px;
  padding: 12px;
  border-color: #e6edf4;
}

.hx-quick-grid .hx-quick-action > .hx-btn-icon:last-child {
  display: none;
}

.hx-quick-grid .hx-quick-action-icon {
  width: 40px;
  height: 40px;
  border-radius: 11px;
}

.hx-quick-grid .hx-quick-action-icon .hx-btn-icon {
  width: 22px;
  height: 22px;
}

.hx-quick-grid .hx-quick-action strong {
  font-size: 14px;
  line-height: 20px;
}

.hx-quick-grid .hx-quick-action small {
  line-height: 18px;
}

.hx-attention-list {
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
}

.hx-detail-trigger {
  position: relative;
  cursor: pointer;
}

.hx-detail-trigger::after {
  content: none;
}

.summary-card.hx-detail-trigger:hover {
  border-color: #b8ddf3 !important;
  box-shadow: 0 8px 22px rgba(0, 119, 200, 0.1) !important;
}

.hx-metric-button {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 1px 5px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: inherit;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.hx-metric-button:hover,
.hx-metric-button:focus-visible {
  background: rgba(0, 119, 200, 0.1);
  color: #0068ad;
}

.hx-metric-static {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 1px 3px;
}

.hx-metric-separator {
  color: #a1adba;
}

.hx-detail-tooltip {
  position: fixed;
  z-index: 12000;
  width: 286px;
  padding: 12px 14px;
  border: 1px solid #d8e4ee;
  border-radius: 11px;
  background: rgba(15, 23, 42, 0.96);
  color: #fff;
  box-shadow: 0 18px 38px rgba(15, 23, 42, 0.24);
  pointer-events: none;
}

.hx-detail-tooltip[hidden] {
  display: none;
}

.hx-detail-tooltip strong {
  display: block;
  margin-bottom: 6px;
  font-size: 13px;
  line-height: 20px;
}

.hx-detail-tooltip p,
.hx-detail-tooltip li {
  margin: 0;
  color: #dbe7f3;
  font-size: 12px;
  line-height: 19px;
}

.hx-detail-tooltip ul {
  margin: 4px 0 0;
  padding: 0;
  list-style: none;
}

.hx-detail-backdrop {
  position: fixed;
  inset: 0;
  z-index: 10900;
  background: rgba(15, 23, 42, 0.28);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.18s ease;
}

.hx-detail-backdrop.is-open {
  opacity: 1;
  pointer-events: auto;
}

.hx-detail-drawer {
  position: fixed;
  top: 0;
  right: 0;
  z-index: 11000;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  width: min(440px, calc(100vw - 48px));
  height: 100vh;
  border-left: 1px solid #dbe5ee;
  background: #fff;
  box-shadow: -18px 0 48px rgba(15, 23, 42, 0.17);
  transform: translateX(102%);
  transition: transform 0.22s ease;
}

.hx-detail-drawer.is-open {
  transform: translateX(0);
}

.hx-detail-drawer-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 20px;
  border-bottom: 1px solid #e8eef4;
}

.hx-detail-drawer-header h2 {
  margin: 0;
  color: #0f172a;
  font-size: 19px;
  line-height: 28px;
}

.hx-detail-drawer-header p {
  margin: 3px 0 0;
  color: #718096;
  font-size: 12px;
  line-height: 18px;
}

.hx-icon-button {
  display: inline-grid;
  flex: 0 0 34px;
  width: 34px;
  height: 34px;
  padding: 0;
  place-items: center;
  border: 1px solid #d9e3ec;
  border-radius: 9px;
  background: #fff;
  color: #526176;
  cursor: pointer;
}

.hx-icon-button:hover {
  border-color: #b9dcef;
  background: #f3faff;
  color: #0077c8;
}

.hx-icon-button svg {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.75;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.hx-detail-drawer-body {
  padding: 18px 20px 28px;
  overflow: auto;
}

.hx-detail-drawer-footer {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding: 14px 20px;
  border-top: 1px solid #e8eef4;
  background: #fff;
}

.hx-detail-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 9px;
  margin-bottom: 18px;
}

.hx-detail-summary > div {
  padding: 12px;
  border: 1px solid #e4ebf2;
  border-radius: 10px;
  background: #f8fafc;
}

.hx-detail-summary strong,
.hx-detail-summary span {
  display: block;
}

.hx-detail-summary strong {
  color: #0f172a;
  font-size: 20px;
  line-height: 26px;
}

.hx-detail-summary span {
  margin-top: 3px;
  color: #718096;
  font-size: 11px;
  line-height: 17px;
}

.hx-detail-section {
  margin-top: 20px;
}

.hx-detail-section h3 {
  margin: 0 0 10px;
  color: #0f172a;
  font-size: 14px;
  line-height: 22px;
}

.hx-detail-list {
  border: 1px solid #e5ebf2;
  border-radius: 10px;
  overflow: hidden;
}

.hx-detail-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  min-height: 44px;
  padding: 8px 11px;
  border-bottom: 1px solid #edf1f5;
}

.hx-detail-row:last-child {
  border-bottom: 0;
}

.hx-detail-row strong {
  overflow: hidden;
  color: #334155;
  font-size: 13px;
  line-height: 20px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.hx-detail-row span {
  color: #64748b;
  font-size: 12px;
}

.hx-detail-row button {
  min-height: 28px !important;
  padding: 0 8px !important;
  font-size: 12px !important;
}

.hx-detail-tabs {
  display: inline-flex;
  gap: 4px;
  margin-bottom: 14px;
  padding: 4px;
  border-radius: 9px;
  background: #eef3f7;
}

.hx-detail-tab {
  min-height: 32px;
  padding: 0 12px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: #64748b;
  font-size: 13px;
  cursor: pointer;
}

.hx-detail-tab.is-active {
  background: #fff;
  color: #0077c8;
  box-shadow: 0 1px 4px rgba(15, 23, 42, 0.1);
  font-weight: 700;
}

.hx-exact-filter-chip {
  display: inline-flex;
  grid-column: 1 / -1;
  align-items: center;
  gap: 7px;
  width: fit-content;
  min-height: 30px;
  padding: 0 9px;
  border: 1px solid #bfe1f5;
  border-radius: 999px;
  background: #edf9ff;
  color: #006ea8;
  font-size: 12px;
  font-weight: 650;
}

.hx-exact-filter-chip button {
  width: 20px;
  height: 20px;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: #d7f0fd;
  color: #006ea8;
  cursor: pointer;
}

/* Unified dialogs */
.hx-admin-v2 .modal.active {
  display: block;
}

.hx-admin-v2 .modal {
  background: rgba(15, 23, 42, 0.42);
  backdrop-filter: blur(2px);
}

.hx-admin-v2 .modal-content {
  position: fixed;
  top: 50%;
  left: 50%;
  display: flex;
  flex-direction: column;
  width: 640px;
  min-width: 420px;
  min-height: 240px;
  max-width: calc(100vw - 24px);
  max-height: calc(100vh - 24px);
  padding: 0;
  border: 1px solid #dce5ee;
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 24px 70px rgba(15, 23, 42, 0.24);
  overflow: hidden;
  resize: none;
  transform: translate(-50%, -50%);
}

.hx-admin-v2 .modal-content.hx-dialog-ready {
  transform: none;
}

.hx-admin-v2 .modal-content.hx-dialog-sm { width: 480px; min-width: 420px; min-height: 240px; }
.hx-admin-v2 .modal-content.hx-dialog-md { width: 640px; min-width: 520px; min-height: 320px; }
.hx-admin-v2 .modal-content.hx-dialog-lg { width: 880px; min-width: 640px; min-height: 420px; }
.hx-admin-v2 .modal-content.hx-dialog-xl { width: 1040px; min-width: 760px; min-height: 520px; }

.hx-admin-v2 .modal-header {
  position: relative;
  flex: 0 0 auto;
  z-index: 18;
  min-height: 64px;
  margin: 0;
  padding: 14px 18px 14px 22px;
  border-bottom: 1px solid #e8eef4;
  background: rgba(255, 255, 255, 0.98);
  cursor: move;
  user-select: none;
  backdrop-filter: blur(8px);
}

.hx-admin-v2 .modal-header h2 {
  color: #0f172a;
  font-size: 18px;
  line-height: 26px;
}

.hx-admin-v2 .modal-header-actions,
.hx-dialog-controls {
  display: flex;
  align-items: center;
  gap: 7px;
}

.hx-dialog-controls {
  margin-left: auto;
}

.hx-admin-v2 .modal-close {
  display: inline-grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border: 1px solid transparent;
  border-radius: 9px;
  color: #64748b;
  font-size: 0;
  cursor: pointer;
}

.hx-admin-v2 .modal-close:hover {
  border-color: #dbe5ee;
  background: #f5f8fb;
  color: #0f172a;
}

.hx-admin-v2 .modal-close svg {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.75;
  stroke-linecap: round;
}

.hx-admin-v2 .modal-footer {
  position: sticky;
  bottom: 0;
  z-index: 16;
  min-height: 66px;
  margin: 0;
  padding: 13px 22px;
  border-top: 1px solid #e8eef4;
  background: rgba(255, 255, 255, 0.98);
  backdrop-filter: blur(8px);
}

.hx-dialog-body {
  min-height: 0;
  flex: 1 1 auto;
  padding: 20px 22px;
  overflow: auto;
  overscroll-behavior: contain;
}

.hx-dialog-form {
  display: flex;
  min-height: 0;
  flex: 1 1 auto;
  flex-direction: column;
  overflow: hidden;
}

.hx-dialog-body > :first-child,
.hx-dialog-body > .hx-form-section:first-child,
.hx-dialog-body > .hx-dialog-section-heading:first-child {
  margin-top: 0;
}

.hx-dialog-body .modal-footer {
  margin: 24px -22px -20px;
}

.hx-admin-v2 .modal-content input:not([type="checkbox"]):not([type="radio"]):not([type="file"]),
.hx-admin-v2 .modal-content select {
  width: 100%;
  min-height: var(--hx-control-height);
  padding: 0 12px;
  border: 1px solid #cfd9e5;
  border-radius: 8px;
  background: #fff;
  color: #1e293b;
  font-size: 14px;
  line-height: 20px;
}

.hx-admin-v2 .modal-content textarea {
  width: 100%;
  min-height: 88px;
  padding: 9px 12px;
  border: 1px solid #cfd9e5;
  border-radius: 8px;
  color: #1e293b;
  font-size: 14px;
  line-height: 22px;
}

.hx-admin-v2 .modal-content input:focus,
.hx-admin-v2 .modal-content select:focus,
.hx-admin-v2 .modal-content textarea:focus {
  border-color: #009eff;
  outline: 3px solid rgba(0, 158, 255, 0.13);
}

.hx-admin-v2 .form-row {
  gap: 16px;
}

.hx-admin-v2 .form-group {
  margin-bottom: 16px;
}

.hx-admin-v2 .form-group label {
  margin-bottom: 6px;
  color: #344256;
  font-size: 13px;
  font-weight: 700;
  line-height: var(--hx-label-line);
}

.hx-admin-v2 .hint-text {
  margin-top: 5px;
  color: #7b899b;
  font-size: 12px;
  line-height: 18px;
}

.hx-admin-v2 .count-summary {
  margin: 12px 0;
  padding: 11px 13px;
  border: 1px solid #cde7f7;
  border-radius: 9px;
  background: #f2faff;
  color: #075985;
  font-size: 13px;
  line-height: 20px;
}

.hx-admin-v2 .checkbox-list {
  padding: 8px;
  border-color: #d8e2eb;
  border-radius: 9px;
  background: #fbfcfe;
}

.hx-admin-v2 .checkbox-list label {
  min-height: 36px;
  margin: 0;
  padding: 6px 8px;
  border-radius: 7px;
}

.hx-admin-v2 .checkbox-list label:hover {
  background: #edf7fd;
}

.hx-form-section {
  margin: 0 0 18px;
  padding: 16px 16px 2px;
  border: 1px solid #e1e9f0;
  border-radius: 11px;
  background: #fbfcfe;
}

.hx-form-section-heading,
.hx-dialog-section-heading {
  margin-bottom: 14px;
}

.hx-form-section-heading h3,
.hx-dialog-section-heading h3 {
  margin: 0;
  color: #0f172a;
  font-size: 14px;
  line-height: 22px;
}

.hx-form-section-heading p,
.hx-dialog-section-heading p {
  margin: 2px 0 0;
  color: #7b899b;
  font-size: 12px;
  line-height: 18px;
}

.hx-dialog-section-heading {
  margin: 20px 0 12px;
  padding-top: 16px;
  border-top: 1px solid #e8eef4;
}

.hx-required-mark {
  margin-left: 3px;
  color: #dc2626;
}

.hx-resize-handle {
  position: absolute;
  z-index: 40;
}

.hx-resize-handle[data-edge="n"], .hx-resize-handle[data-edge="s"] { left: 10px; width: calc(100% - 20px); height: 7px; cursor: ns-resize; }
.hx-resize-handle[data-edge="n"] { top: 0; }
.hx-resize-handle[data-edge="s"] { bottom: 0; }
.hx-resize-handle[data-edge="e"], .hx-resize-handle[data-edge="w"] { top: 10px; width: 7px; height: calc(100% - 20px); cursor: ew-resize; }
.hx-resize-handle[data-edge="e"] { right: 0; }
.hx-resize-handle[data-edge="w"] { left: 0; }
.hx-resize-handle[data-edge="ne"], .hx-resize-handle[data-edge="nw"], .hx-resize-handle[data-edge="se"], .hx-resize-handle[data-edge="sw"] { width: 13px; height: 13px; }
.hx-resize-handle[data-edge="ne"] { top: 0; right: 0; cursor: nesw-resize; }
.hx-resize-handle[data-edge="nw"] { top: 0; left: 0; cursor: nwse-resize; }
.hx-resize-handle[data-edge="se"] { right: 0; bottom: 0; cursor: nwse-resize; }
.hx-resize-handle[data-edge="sw"] { bottom: 0; left: 0; cursor: nesw-resize; }

.hx-admin-v2 .preview-table {
  border-color: #dce5ed;
  border-radius: 9px;
}

.hx-property-table {
  width: 100%;
  min-width: 1640px;
  table-layout: fixed;
}

.hx-property-table th,
.hx-property-table td {
  padding-right: 10px;
  padding-left: 10px;
  white-space: nowrap;
}

.hx-property-table th:nth-child(1), .hx-property-table td:nth-child(1) { width: 62px; }
.hx-property-table th:nth-child(2), .hx-property-table td:nth-child(2) { width: 128px; }
.hx-property-table th:nth-child(3), .hx-property-table td:nth-child(3) { width: 70px; }
.hx-property-table th:nth-child(4), .hx-property-table td:nth-child(4) { width: 86px; }
.hx-property-table th:nth-child(5), .hx-property-table td:nth-child(5) { width: 190px; }
.hx-property-table th:nth-child(6), .hx-property-table td:nth-child(6) { width: 82px; }
.hx-property-table th:nth-child(7), .hx-property-table td:nth-child(7) { width: 104px; }
.hx-property-table th:nth-child(8), .hx-property-table td:nth-child(8) { width: 86px; }
.hx-property-table th:nth-child(9), .hx-property-table td:nth-child(9) { width: 76px; }
.hx-property-table th:nth-child(n+10):nth-child(-n+18),
.hx-property-table td:nth-child(n+10):nth-child(-n+18) { width: 72px; text-align: right; }
.hx-property-table th:nth-child(19), .hx-property-table td:nth-child(19) { width: 132px; }

.hx-property-table tbody tr:not(.property-city-group) td:nth-child(1),
.hx-property-table tbody tr:not(.property-city-group) td:nth-child(2),
.hx-property-table thead th:nth-child(1),
.hx-property-table thead th:nth-child(2) {
  position: sticky;
  z-index: 3;
  background: #fff;
}

.hx-property-table thead th:nth-child(1),
.hx-property-table tbody tr:not(.property-city-group) td:nth-child(1) { left: 0; }
.hx-property-table thead th:nth-child(2),
.hx-property-table tbody tr:not(.property-city-group) td:nth-child(2) { left: 62px; }
.hx-property-table thead th:nth-child(1),
.hx-property-table thead th:nth-child(2) { z-index: 6; background: #f7f9fc; }
.hx-property-table tbody tr:hover td:nth-child(1),
.hx-property-table tbody tr:hover td:nth-child(2) { background: #f8fbfe; }

.hx-admin-v2 .preview-table thead th {
  top: 0;
}

.hx-admin-v2 #tab-log .list-filter-bar,
.hx-admin-v2 #tab-audit .account-filter-row {
  padding: 16px;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  background: #fff;
}

.hx-admin-v2 #tab-log .list-filter-bar {
  grid-template-columns: auto 150px auto 150px 190px minmax(200px, 1fr) auto auto;
}

@media (max-width: 1366px) {
  .hx-quick-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

.hx-admin-v2 .modal-content.hx-dialog-xl {
    width: min(1040px, calc(100vw - 32px));
  }
}

.hx-admin-v2 .modal {
  z-index: 11500;
}

.hx-admin-v2 #processModal {
  z-index: 12500;
}

.hx-auto-btn-icon,
.hx-exact-filter-chip svg {
  width: 16px;
  height: 16px;
  flex: 0 0 16px;
  stroke-width: 1.75;
}

.hx-detail-row {
  grid-template-columns: minmax(0, 1fr) auto auto;
}

.hx-detail-row > span:last-child {
  grid-column: 2 / -1;
}

.hx-detail-row > .row-action-btn {
  grid-column: 3;
}
