/* Additions to the original stylesheet: the modal, the detail grid and a couple of
   form controls the recovered CSS had no classes for. Everything uses the existing
   design tokens so it matches the rest of the app. */

.hmc-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, .45);
  backdrop-filter: blur(2px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 400;
}

.hmc-modal {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  width: min(560px, 100%);
  max-height: min(80vh, 720px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.hmc-modal-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 18px;
  border-bottom: 1px solid var(--border);
}

.hmc-modal-body { padding: 16px 18px; overflow-y: auto; flex: 1 1 auto; }

.hmc-modal-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 18px;
  border-top: 1px solid var(--border);
  background: var(--surface-2);
}

.hmc-detail-grid { display: flex; flex-direction: column; gap: 1px; background: var(--border); border: 1px solid var(--border); border-radius: var(--radius-sm); overflow: hidden; }
.hmc-detail-row { display: flex; gap: 12px; padding: 10px 14px; background: var(--surface); }
.hmc-detail-key { flex: 0 0 42%; font-size: 12.5px; color: var(--text-secondary); }
.hmc-detail-val { flex: 1; font-size: 13px; font-weight: 600; color: var(--text-primary); word-break: break-word; }

.hmc-history-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 11px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  margin-bottom: 8px;
  cursor: pointer;
  transition: background .15s, border-color .15s;
}
.hmc-history-row:hover { background: var(--surface-2); border-color: var(--border-strong); }

.hmc-select,
.hmc-modal input[type="text"],
.search-row input[type="text"],
.search-row input[type="date"] {
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-xs);
  font-size: 13px;
  font-family: inherit;
  color: var(--text-primary);
  background: var(--surface);
}
.hmc-select:focus, .search-row input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(99,102,241,.1); }

@media (max-width: 768px) {
  .hmc-modal { max-height: 88vh; }
  .hmc-detail-key { flex-basis: 46%; }
  .hmc-modal-foot { flex-direction: column-reverse; align-items: stretch; }
}
