@font-face {
  font-family: 'Plus Jakarta Sans';
  src: url('/static/fonts/PlusJakartaSans/static/PlusJakartaSans-Regular.ttf') format('truetype');
  font-weight: 400;
  font-style: normal;
}

@font-face {
  font-family: 'Plus Jakarta Sans';
  src: url('/static/fonts/PlusJakartaSans/static/PlusJakartaSans-Medium.ttf') format('truetype');
  font-weight: 500;
  font-style: normal;
}

@font-face {
  font-family: 'Plus Jakarta Sans';
  src: url('/static/fonts/PlusJakartaSans/static/PlusJakartaSans-SemiBold.ttf') format('truetype');
  font-weight: 600;
  font-style: normal;
}

@font-face {
  font-family: 'Plus Jakarta Sans';
  src: url('/static/fonts/PlusJakartaSans/static/PlusJakartaSans-Bold.ttf') format('truetype');
  font-weight: 700;
  font-style: normal;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

.hx-database-manager {
  font-family: 'Plus Jakarta Sans', sans-serif;
  background: #f4f5f7;
  min-height: 100vh;
  margin: 0;
  padding: 0;
  color: #1a1d23;
}

.dm-hidden {
  display: none !important;
}

.dm-header {
  display: flex;
  justify-content: center;
  padding: 24px 0 8px;
}

#company_logo {
  height: 36px;
  object-fit: contain;
}

.dm-container {
  max-width: 980px;
  margin: 0 auto;
  padding: 0 24px 48px;
}

.dm-tabs {
  display: flex;
  justify-content: center;
  border-bottom: 1px solid #e2e4e9;
  margin-bottom: 28px;
  gap: 0;
}

.dm-tab {
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  padding: 14px 20px;
  font-family: inherit;
  font-size: 14px;
  font-weight: 500;
  color: #6b7280;
  cursor: pointer;
  transition:
    color 0.15s,
    border-color 0.15s;
  margin-bottom: -1px;
  white-space: nowrap;
}

.dm-tab:hover {
  color: #374151;
}

.dm-tab.active {
  color: #2563eb;
  border-bottom-color: #2563eb;
  font-weight: 600;
}

.dm-section-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 20px;
  gap: 16px;
}

.dm-section-title {
  font-size: 18px;
  font-weight: 700;
  margin: 0 0 4px;
}

.dm-section-subtitle {
  font-size: 13px;
  color: #6b7280;
  margin: 0;
}

.dm-db-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.dm-db-card {
  display: flex;
  align-items: center;
  gap: 14px;
  background: #fff;
  border: 1px solid #e2e4e9;
  border-radius: 12px;
  padding: 16px 20px;
  transition: box-shadow 0.15s;
}

.dm-db-card:hover {
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.07);
}

.dm-db-icon {
  width: 40px;
  height: 40px;
  background: #eff6ff;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: #2563eb;
}

.dm-db-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.dm-db-name {
  font-size: 15px;
  font-weight: 600;
  color: #111827;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.dm-db-meta {
  font-size: 12px;
  color: #6b7280;
}

.dm-action-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 24px;
}

.dm-action-card {
  display: flex;
  align-items: center;
  gap: 14px;
  background: #fff;
  border: 1px solid #e2e4e9;
  border-radius: 12px;
  padding: 18px 20px;
  cursor: pointer;
  font-family: inherit;
  font-size: 15px;
  font-weight: 600;
  color: #111827;
  text-align: left;
  transition:
    box-shadow 0.15s,
    border-color 0.15s;
}

.dm-action-card:hover {
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.07);
  border-color: #c7d2fe;
}

.dm-action-icon {
  width: 44px;
  height: 44px;
  background: #eff6ff;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: #2563eb;
}

.dm-action-label {
  font-size: 15px;
  font-weight: 600;
}

.dm-card {
  background: #fff;
  border: 1px solid #e2e4e9;
  border-radius: 12px;
  overflow: hidden;
}

.dm-card-header {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 18px 20px;
  border-bottom: 1px solid #f1f3f5;
}

.dm-card-icon {
  width: 40px;
  height: 40px;
  background: #eff6ff;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: #2563eb;
}

.dm-card-icon-danger {
  background: #fef2f2;
  color: #dc2626;
}

.dm-card-title {
  font-size: 15px;
  font-weight: 700;
  margin: 0 0 2px;
}

.dm-card-subtitle {
  font-size: 12px;
  color: #6b7280;
  margin: 0;
}

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

.dm-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.dm-table thead th {
  text-align: left;
  padding: 10px 16px;
  font-size: 12px;
  font-weight: 600;
  color: #6b7280;
  background: #f9fafb;
  border-bottom: 1px solid #e2e4e9;
  white-space: nowrap;
}

.dm-table tbody tr {
  border-bottom: 1px solid #f1f3f5;
  transition: background 0.1s;
}

.dm-table tbody tr:last-child {
  border-bottom: none;
}

.dm-table tbody tr:hover {
  background: #fafbfc;
}

.dm-table tbody td {
  padding: 13px 16px;
  color: #374151;
  vertical-align: middle;
}

.dm-table-empty td {
  text-align: center;
  color: #9ca3af;
  padding: 32px 16px;
  font-size: 13px;
}

.dm-file-cell {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #374151;
}

.dm-file-cell svg {
  flex-shrink: 0;
  color: #6b7280;
}

.dm-actions-cell {
  display: flex;
  align-items: center;
  gap: 8px;
}

.dm-icon-btn {
  width: 30px;
  height: 30px;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s;
}

.dm-icon-btn-blue {
  background: #eff6ff;
  color: #2563eb;
}

.dm-icon-btn-blue:hover {
  background: #dbeafe;
}

.dm-icon-btn-red {
  background: #fef2f2;
  color: #dc2626;
}

.dm-icon-btn-red:hover {
  background: #fee2e2;
}

.dm-danger-zone {
  padding: 16px 20px 20px;
}

.dm-danger-warning {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  background: #fef2f2;
  border: 1px solid #fecaca;
  border-radius: 8px;
  padding: 12px 14px;
  margin-bottom: 16px;
  font-size: 13px;
  color: #991b1b;
  flex-wrap: wrap;
}

.dm-danger-warning svg {
  flex-shrink: 0;
  color: #f59e0b;
  margin-top: 1px;
}

.dm-danger-warning strong {
  color: #dc2626;
  font-weight: 600;
  width: 100%;
}

.dm-danger-warning span {
  color: #7f1d1d;
}

.dm-danger-warning code {
  font-family: ui-monospace, 'SF Mono', monospace;
  font-size: 12px;
  background: rgba(0, 0, 0, 0.08);
  padding: 1px 5px;
  border-radius: 4px;
}

.dm-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 16px;
  border: none;
  border-radius: 8px;
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition:
    background 0.15s,
    opacity 0.15s;
  white-space: nowrap;
}

.dm-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.dm-btn-primary {
  background: #2563eb;
  color: #fff;
}

.dm-btn-primary:hover:not(:disabled) {
  background: #1d4ed8;
}

.dm-btn-secondary {
  background: #f3f4f6;
  color: #374151;
}

.dm-btn-secondary:hover:not(:disabled) {
  background: #e5e7eb;
}

.dm-btn-danger {
  background: #dc2626;
  color: #fff;
}

.dm-btn-danger:hover:not(:disabled) {
  background: #b91c1c;
}

.dm-btn-sm {
  padding: 7px 13px;
  font-size: 13px;
}

.dm-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
}

.dm-badge-success {
  background: #d1fae5;
  color: #065f46;
}

.dm-badge-fail {
  background: #fee2e2;
  color: #991b1b;
}

.dm-badge-pending {
  background: #fef9c3;
  color: #854d0e;
}

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

.dm-modal-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  cursor: pointer;
}

.dm-modal-box {
  position: relative;
  background: #fff;
  border-radius: 14px;
  width: 100%;
  max-width: 480px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 8px 40px rgba(0, 0, 0, 0.18);
  z-index: 1;
  display: flex;
  flex-direction: column;
}

.dm-modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  border-bottom: 1px solid #f1f3f5;
  flex-shrink: 0;
}

.dm-modal-head h3 {
  font-size: 17px;
  font-weight: 700;
  margin: 0;
}

.dm-modal-close {
  background: none;
  border: none;
  font-size: 22px;
  cursor: pointer;
  color: #6b7280;
  line-height: 1;
  padding: 2px 6px;
  border-radius: 6px;
}

.dm-modal-close:hover {
  background: #f3f4f6;
}

.dm-modal-body {
  padding: 20px 24px;
  flex: 1;
}

.dm-modal-foot {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 16px 24px;
  border-top: 1px solid #f1f3f5;
  flex-shrink: 0;
  background: #fff;
  border-radius: 0 0 14px 14px;
}

.dm-field {
  margin-bottom: 14px;
}

.dm-label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: #374151;
  margin-bottom: 5px;
}

.dm-input {
  width: 100%;
  padding: 9px 12px;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  font-family: inherit;
  font-size: 14px;
  color: #111827;
  background: #fff;
  transition: border-color 0.15s;
  outline: none;
}

.dm-input:focus {
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.dm-input::placeholder {
  color: #9ca3af;
}

.dm-radio-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.dm-radio-option {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  cursor: pointer;
  color: #374151;
}

.dm-radio-option input[type='radio'] {
  accent-color: #2563eb;
}

.dm-file-input {
  display: flex;
  align-items: center;
  gap: 10px;
}

.dm-file-name {
  font-size: 13px;
  color: #6b7280;
}

.dm-freeze-list {
  margin-top: 16px;
  border-top: 1px solid #f1f3f5;
  padding-top: 14px;
}

.dm-hint {
  font-size: 13px;
  color: #6b7280;
  margin: 0;
}

.dm-progress-area {
  margin-top: 10px;
  min-height: 0;
}

.dm-progress {
  height: 6px;
  background: #e5e7eb;
  border-radius: 99px;
  overflow: hidden;
  margin-bottom: 6px;
}

.dm-progress-bar {
  height: 100%;
  background: #2563eb;
  border-radius: 99px;
  transition: width 0.3s;
}

.dm-progress-msg {
  font-size: 12px;
  color: #6b7280;
  margin: 0;
}

.dm-loading {
  padding: 20px;
  text-align: center;
  color: #9ca3af;
  font-size: 14px;
}

.dm-empty {
  padding: 32px;
  text-align: center;
  color: #9ca3af;
  font-size: 14px;
}

.dm-error {
  padding: 20px;
  text-align: center;
  color: #dc2626;
  font-size: 14px;
}

.dm-toast {
  position: fixed;
  bottom: 28px;
  right: 28px;
  padding: 12px 18px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 500;
  font-family: 'Plus Jakarta Sans', sans-serif;
  z-index: 9999;
  transform: translateY(12px);
  opacity: 0;
  transition:
    opacity 0.25s,
    transform 0.25s;
  pointer-events: none;
  max-width: 320px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.14);
}

.dm-toast-show {
  opacity: 1;
  transform: translateY(0);
}

.dm-toast-success {
  background: #d1fae5;
  color: #065f46;
  border: 1px solid #a7f3d0;
}

.dm-toast-error {
  background: #fee2e2;
  color: #991b1b;
  border: 1px solid #fecaca;
}

.dm-toast-info {
  background: #eff6ff;
  color: #1e40af;
  border: 1px solid #bfdbfe;
}

@media (max-width: 640px) {
  .dm-container {
    padding: 0 12px 32px;
  }

  .dm-action-grid {
    grid-template-columns: 1fr;
  }

  .dm-tabs {
    overflow-x: auto;
  }

  .dm-section-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .dm-modal-box {
    max-width: calc(100vw - 24px);
    margin: 12px;
  }

  .dm-db-card {
    flex-wrap: wrap;
  }
}

.dm-error-msg {
  font-size: 13px;
  color: #dc2626;
  margin: 6px 0 0;
}
