.mfui-overlay[hidden] {
  display: none !important;
}

.mfui-overlay {
  position: fixed;
  inset: 0;
  z-index: 1400;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(4, 10, 18, 0.74);
  backdrop-filter: blur(7px);
  color: #e9f0f8;
}

.mfui-dialog {
  --mfui-border: rgba(139, 162, 190, 0.28);
  --mfui-panel: rgba(15, 27, 42, 0.96);
  --mfui-muted: #91a3b8;
  width: min(1180px, 96vw);
  max-height: min(880px, 94vh);
  overflow: hidden;
  border: 1px solid var(--mfui-border);
  border-radius: 16px;
  background: #0b1624;
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.52);
  font-family: "Segoe UI", "Malgun Gothic", sans-serif;
}

.mfui-header,
.mfui-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 20px;
  border-color: var(--mfui-border);
  background: linear-gradient(135deg, rgba(20, 39, 59, 0.98), rgba(9, 21, 35, 0.98));
}

.mfui-header {
  border-bottom: 1px solid var(--mfui-border);
}

.mfui-footer {
  align-items: flex-start;
  border-top: 1px solid var(--mfui-border);
}

.mfui-heading {
  min-width: 0;
}

.mfui-title,
.mfui-editor-title,
.mfui-subtitle,
.mfui-status,
.mfui-quarantine,
.mfui-list-state,
.mfui-stock-state,
.mfui-empty {
  margin: 0;
}

.mfui-title {
  color: #f5f9ff;
  font-size: 22px;
  line-height: 1.25;
}

.mfui-subtitle,
.mfui-list-state,
.mfui-stock-state,
.mfui-empty {
  color: var(--mfui-muted);
  font-size: 12px;
}

.mfui-subtitle {
  margin-top: 4px;
}

.mfui-body {
  display: grid;
  grid-template-columns: minmax(250px, 0.72fr) minmax(520px, 1.8fr);
  min-height: 560px;
  max-height: calc(94vh - 150px);
}

.mfui-list-panel,
.mfui-editor {
  min-height: 0;
  padding: 18px;
}

.mfui-list-panel {
  display: grid;
  grid-template-rows: auto auto auto minmax(0, 1fr);
  gap: 12px;
  border-right: 1px solid var(--mfui-border);
  background: rgba(8, 19, 31, 0.92);
}

.mfui-editor {
  overflow: auto;
  background: var(--mfui-panel);
}

.mfui-editor-title {
  color: #f1f6fc;
  font-size: 17px;
}

.mfui-stock-state {
  margin: 5px 0 15px;
}

.mfui-search {
  display: grid;
  grid-template-columns: minmax(76px, 1fr) auto auto auto;
  gap: 8px;
}

.mfui-search-input,
.mfui-input {
  min-width: 0;
  border: 1px solid rgba(135, 158, 186, 0.34);
  border-radius: 8px;
  outline: none;
  background: rgba(4, 14, 25, 0.88);
  color: #f1f6fc;
  transition: border-color 120ms ease, box-shadow 120ms ease;
}

.mfui-search-input {
  height: 38px;
  padding: 0 11px;
}

.mfui-input {
  width: 100%;
  height: 34px;
  padding: 0 9px;
  box-sizing: border-box;
}

.mfui-search-input:focus,
.mfui-input:focus {
  border-color: #55a9ed;
  box-shadow: 0 0 0 3px rgba(65, 151, 221, 0.16);
}

.mfui-input[readonly] {
  color: #aebdcd;
  background: rgba(30, 43, 58, 0.82);
}

.mfui-list {
  min-height: 0;
  overflow: auto;
  border: 1px solid rgba(135, 158, 186, 0.18);
  border-radius: 10px;
  background: rgba(2, 10, 19, 0.48);
}

.mfui-list-sort {
  width: 100%;
  min-height: 30px;
  padding: 0 11px;
  border: 1px solid rgba(135, 158, 186, 0.24);
  border-radius: 7px;
  background: rgba(19, 37, 56, 0.88);
  color: #b8c9da;
  font-size: 11px;
  font-weight: 700;
  text-align: left;
  cursor: pointer;
}

.mfui-list-sort:hover,
.mfui-list-sort:focus-visible {
  border-color: #55a9ed;
  color: #fff;
  outline: none;
}

.mfui-list-sort[data-direction="descending"] {
  color: #73b8ee;
}

.mfui-list-row {
  width: 100%;
  padding: 10px 12px;
  border: 0;
  border-bottom: 1px solid rgba(135, 158, 186, 0.14);
  background: transparent;
  color: #dce7f3;
  text-align: left;
  cursor: pointer;
}

.mfui-list-row:hover,
.mfui-list-row[aria-selected="true"] {
  background: rgba(42, 125, 191, 0.24);
  color: #fff;
}

.mfui-empty {
  padding: 18px 12px;
  text-align: center;
}

.mfui-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.mfui-field {
  display: grid;
  gap: 5px;
  min-width: 0;
}

.mfui-field-label {
  color: #aebdcd;
  font-size: 11px;
  font-weight: 650;
}

.mfui-group {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px;
  min-width: 0;
  margin: 0;
  padding: 10px;
  border: 1px solid rgba(135, 158, 186, 0.2);
  border-radius: 10px;
  background: rgba(6, 17, 29, 0.52);
}

.mfui-group-title {
  padding: 0 5px;
  color: #73b8ee;
  font-size: 11px;
  font-weight: 700;
}

.mfui-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 18px;
  padding-top: 15px;
  border-top: 1px solid rgba(135, 158, 186, 0.18);
}

.mfui-button,
.mfui-search-button,
.mfui-find-button,
.mfui-close {
  min-height: 36px;
  padding: 0 13px;
  border: 1px solid rgba(135, 158, 186, 0.36);
  border-radius: 8px;
  background: rgba(30, 49, 69, 0.92);
  color: #e8f0f8;
  font-weight: 650;
  cursor: pointer;
}

.mfui-button:hover:not(:disabled),
.mfui-search-button:hover:not(:disabled),
.mfui-find-button:hover:not(:disabled),
.mfui-close:hover:not(:disabled) {
  border-color: #78b9eb;
  background: rgba(43, 75, 105, 0.96);
}

.mfui-primary {
  border-color: rgba(65, 164, 226, 0.64);
  background: #1671b5;
}

.mfui-accent {
  border-color: rgba(72, 194, 147, 0.64);
  background: #147b59;
}

.mfui-danger {
  border-color: rgba(224, 100, 108, 0.54);
  background: rgba(119, 41, 50, 0.9);
}

.mfui-button:disabled,
.mfui-search-button:disabled,
.mfui-find-button:disabled {
  opacity: 0.42;
  cursor: not-allowed;
}

.mfui-search-button,
.mfui-find-button {
  padding-inline: 9px;
  white-space: nowrap;
}

.mfui-status {
  color: #c6d4e2;
  font-size: 12px;
}

.mfui-status[data-status="error"],
.mfui-status[data-status="quarantined"],
.mfui-quarantine {
  color: #ff9da5;
}

.mfui-quarantine {
  max-width: 58%;
  font-size: 12px;
  font-weight: 700;
  text-align: right;
}

@media (max-width: 820px) {
  .mfui-overlay {
    padding: 8px;
  }

  .mfui-dialog {
    width: 100%;
    max-height: 98vh;
  }

  .mfui-body {
    grid-template-columns: 1fr;
    overflow: auto;
  }

  .mfui-list-panel {
    min-height: 260px;
    border-right: 0;
    border-bottom: 1px solid var(--mfui-border);
  }

  .mfui-editor {
    overflow: visible;
  }

  .mfui-form {
    grid-template-columns: 1fr;
  }

  .mfui-search {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .mfui-find-button {
    width: 100%;
  }

  .mfui-quarantine {
    max-width: none;
  }
}
