.dt-shell {
  font-family: "IBM Plex Sans", "Segoe UI", sans-serif;
  color: #1f2933;
  background: linear-gradient(180deg, #ffffff 0%, #f7fafc 100%);
  border: 1px solid #d9e2ec;
  border-radius: 16px;
  padding: 20px;
  box-shadow: 0 14px 34px rgba(15, 23, 42, 0.08);
}

.dt-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 16px;
  margin-bottom: 16px;
}

.dt-search {
  display: grid;
  gap: 6px;
  min-width: min(100%, 280px);
}

.dt-search__label {
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #486581;
}

.dt-search__input {
  width: 100%;
  border: 1px solid #bcccdc;
  border-radius: 10px;
  padding: 10px 12px;
  font: inherit;
}

.dt-meta {
  font-size: 0.95rem;
  color: #52606d;
}

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

.dt-table {
  width: 100%;
  border-collapse: collapse;
}

.dt-table th,
.dt-table td {
  padding: 12px 14px;
  border-bottom: 1px solid #e4e7eb;
  text-align: left;
}

.dt-table th,
.dt-header-cell {
  font-size: 0.88rem;
  color: #334e68;
  background: #f0f4f8;
}

.dt-table th.is-sortable,
.dt-header-cell.is-sortable {
  cursor: pointer;
  user-select: none;
}

.dt-table tbody tr:hover {
  background: rgba(45, 125, 154, 0.06);
}

.dt-group-cell {
  background: linear-gradient(90deg, #e8f1f8, #f8fbfd);
  color: #243b53;
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.dt-detail-toggle-cell {
  width: 1%;
  white-space: nowrap;
}

.dt-detail-toggle {
  border: none;
  border-radius: 999px;
  padding: 7px 10px;
  background: #d9e2ec;
  color: #102a43;
  font: inherit;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
}

.dt-detail-row td,
.dt-detail-cell {
  background: #f8fbfd;
  color: #334e68;
}

.dt-empty,
.dt-loading {
  text-align: center;
  color: #7b8794;
  padding: 28px 14px;
}

.dt-loading {
  font-weight: 600;
}

.dt-skeleton {
  height: 14px;
  width: 100%;
  background: linear-gradient(90deg, #f0f4f8 25%, #e2e8f0 50%, #f0f4f8 75%);
  background-size: 200% 100%;
  animation: dt-skeleton-loading 1.5s infinite linear;
  border-radius: 4px;
}

@keyframes dt-skeleton-loading {
  0% {
    background-position: 200% 0;
  }
  100% {
    background-position: -200% 0;
  }
}

.dt-pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 16px;
}

.dt-pagination button {
  border: none;
  border-radius: 10px;
  padding: 10px 14px;
  background: #2d7d9a;
  color: #fff;
  font: inherit;
  cursor: pointer;
}

.dt-button {
  border: none;
  border-radius: 999px;
  padding: 10px 14px;
  background: #2d7d9a;
  color: #fff;
  font: inherit;
  cursor: pointer;
}

.dt-pagination__pages {
  display: flex;
  align-items: center;
  gap: 8px;
}

.dt-pagination__page {
  min-width: 42px;
  background: #d9e2ec !important;
  color: #102a43 !important;
}

.dt-pagination__page.is-active {
  background: #102a43 !important;
  color: #ffffff !important;
}

.dt-pagination__gap {
  color: #7b8794;
  font-weight: 600;
}

.dt-pagination button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.dt-pagination__status {
  color: #334e68;
}

@media (max-width: 640px) {
  .dt-shell {
    padding: 16px;
  }

  .dt-toolbar {
    flex-direction: column;
    align-items: stretch;
  }

  .dt-pagination {
    justify-content: space-between;
  }

  .dt-pagination__pages {
    order: 3;
    width: 100%;
    justify-content: center;
  }
}

/* Inline Editor */
.dt-editable {
  cursor: pointer;
  position: relative;
}

.dt-editable:hover {
  background-color: rgba(15, 118, 110, 0.05) !important;
}

.dt-editable::after {
  content: "✎";
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
  opacity: 0;
  transition: opacity 0.2s;
  pointer-events: none;
  font-size: 0.8rem;
}

.dt-editable:hover::after {
  opacity: 0.4;
}

.dt-editor-input {
  border: 2px solid #0f766e !important;
  border-radius: 6px !important;
  padding: 4px 8px !important;
  font-family: inherit !important;
  font-size: inherit !important;
  outline: none !important;
  background: white !important;
  color: #102a43 !important;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1) !important;
}

.dt-toolbar-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
}

.dt-create-entry {
  display: flex;
  align-items: center;
}

.dt-create-trigger,
.dt-create-submit,
.dt-create-cancel {
  appearance: none;
  border: none;
  border-radius: 999px;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.dt-create-trigger,
.dt-create-submit {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #102a43, #2d7d9a);
  color: #ffffff;
  padding: 10px 16px;
  box-shadow: 0 12px 24px rgba(16, 42, 67, 0.16);
}

.dt-create-trigger:hover,
.dt-create-submit:hover {
  filter: brightness(1.05);
}

.dt-create-cancel {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #d9e2ec;
  color: #243b53;
  padding: 10px 16px;
}

.dt-row--highlight td {
  animation: dt-row-highlight 2.6s ease;
}

@keyframes dt-row-highlight {
  0% {
    background: rgba(56, 189, 248, 0.26);
  }
  100% {
    background: transparent;
  }
}

.dt-live-status {
  display: flex;
  align-items: center;
  min-height: 34px;
}

.dt-live-button {
  appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: #f1f5f9;
  border: 1px solid #cbd5e0;
  border-radius: 999px;
  padding: 6px 12px;
  min-height: 34px;
  font-size: 0.72rem;
  font-weight: 700;
  line-height: 1;
  text-transform: uppercase;
  white-space: nowrap;
  cursor: pointer;
  transition:
    background-color 0.2s ease,
    border-color 0.2s ease,
    color 0.2s ease,
    box-shadow 0.2s ease,
    opacity 0.2s ease;
  color: #4a5568;
}

.dt-live-button:hover {
  background: #e2e8f0;
}

.dt-live-button:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(45, 125, 154, 0.18);
}

.dt-live-button.is-active {
  color: #059669;
  border-color: #10b981;
  background: #ecfdf5;
}

.dt-live-button.is-paused {
  color: #718096;
  opacity: 0.8;
}

.dt-live-button.is-syncing {
  color: #2563eb;
  border-color: #60a5fa;
  background: #eff6ff;
}

.dt-live-button.is-success {
  color: #059669;
  border-color: #10b981;
  background: #ecfdf5;
}

.dt-live-button.is-error {
  color: #dc2626;
  border-color: #f87171;
  background: #fef2f2;
}

.dt-live-dot {
  flex: 0 0 auto;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: currentColor;
}

.dt-live-label {
  line-height: 1;
}

.is-syncing .dt-live-dot {
  animation: dt-pulse-blue 1.25s infinite;
}

.is-active .dt-live-dot {
  animation: dt-pulse 2s infinite;
}

@keyframes dt-pulse {
  0% {
    transform: scale(0.95);
    box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7);
  }
  70% {
    transform: scale(1);
    box-shadow: 0 0 0 6px rgba(16, 185, 129, 0);
  }
  100% {
    transform: scale(0.95);
    box-shadow: 0 0 0 0 rgba(16, 185, 129, 0);
  }
}

@keyframes dt-pulse-blue {
  0% {
    transform: scale(0.95);
    box-shadow: 0 0 0 0 rgba(59, 130, 246, 0.5);
  }
  70% {
    transform: scale(1);
    box-shadow: 0 0 0 6px rgba(59, 130, 246, 0);
  }
  100% {
    transform: scale(0.95);
    box-shadow: 0 0 0 0 rgba(59, 130, 246, 0);
  }
}

.dt-modal-region {
  position: relative;
  z-index: 20;
}

.dt-create-modal-backdrop {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(15, 23, 42, 0.42);
  backdrop-filter: blur(6px);
}

.dt-create-modal {
  width: min(100%, 720px);
  max-height: calc(100vh - 48px);
  overflow: auto;
  background: linear-gradient(180deg, #ffffff 0%, #f8fbfd 100%);
  border: 1px solid #d9e2ec;
  border-radius: 24px;
  box-shadow: 0 32px 80px rgba(15, 23, 42, 0.24);
  padding: 24px;
}

.dt-create-modal__header {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
}

.dt-create-modal__title {
  margin: 0;
  font-size: 1.3rem;
  color: #102a43;
}

.dt-create-modal__description {
  margin: 8px 0 0;
  color: #52606d;
}

.dt-create-close {
  appearance: none;
  border: none;
  background: transparent;
  color: #52606d;
  cursor: pointer;
  font-size: 1.8rem;
  line-height: 1;
}

.dt-create-form {
  display: grid;
  gap: 18px;
}

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

.dt-create-field {
  display: grid;
  gap: 8px;
}

.dt-create-field--checkbox {
  grid-template-columns: auto 1fr;
  align-items: center;
}

.dt-create-label {
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #486581;
}

.dt-create-input {
  width: 100%;
  border: 1px solid #bcccdc;
  border-radius: 14px;
  padding: 12px 14px;
  font: inherit;
  color: #102a43;
  background: #ffffff;
}

.dt-create-input:focus-visible {
  outline: none;
  border-color: #2d7d9a;
  box-shadow: 0 0 0 3px rgba(45, 125, 154, 0.18);
}

.dt-create-input.is-invalid {
  border-color: #ef4444;
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.12);
}

.dt-create-error,
.dt-create-form-error {
  color: #b91c1c;
  font-size: 0.82rem;
}

.dt-create-form-error {
  background: #fef2f2;
  border: 1px solid #fecaca;
  border-radius: 14px;
  padding: 12px 14px;
}

.dt-create-actions {
  display: flex;
  justify-content: end;
  gap: 12px;
}

.dt-toast-region {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 30;
}

.dt-toast {
  min-width: 220px;
  max-width: min(360px, calc(100vw - 32px));
  border-radius: 16px;
  padding: 12px 16px;
  color: #ffffff;
  box-shadow: 0 18px 40px rgba(15, 23, 42, 0.18);
}

.dt-toast--success,
.dt-toast--info {
  background: #102a43;
}

.dt-toast--error {
  background: #b91c1c;
}

@media (max-width: 640px) {
  .dt-create-grid {
    grid-template-columns: 1fr;
  }

  .dt-create-actions {
    flex-direction: column-reverse;
  }

  .dt-create-submit,
  .dt-create-cancel,
  .dt-create-trigger {
    width: 100%;
  }
}
