/*
version: 1.5.1
revision: 2026.05.17.19.25.22
*/

:root {
  --dt-bg: #f7f8fa;
  --dt-panel: #ffffff;
  --dt-border: #d8dee8;
  --dt-text: #1f2937;
  --dt-muted: #667085;
  --dt-accent: #146c63;
  --dt-accent-soft: #e7f4f1;
  --dt-danger: #b42318;
}

body {
  margin: 0;
  background: var(--dt-bg);
  color: var(--dt-text);
  font-family: Inter, Segoe UI, Arial, sans-serif;
}

#app,
.dt-app-shell,
.dt-main-panel {
  min-height: 100vh;
}

.dt-app-header {
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  height: 52px;
  padding: 0 18px;
  border-bottom: 1px solid var(--dt-border);
  background: #f0f4f8;
  margin: 0;
}

.dt-current-user .bf-field-display {
  color: var(--dt-muted);
  font-size: 13px;
}

.dt-sidebar {
  background: #fff;
  color: var(--dt-text);
  height: 100vh;
  padding: 14px;
  width: 236px;
  box-sizing: border-box;
  border-right: 1px solid var(--dt-border);
  flex-shrink: 0;
  position: sticky;
  top: 0;
  overflow: hidden;
}

.dt-main-panel {
  flex: 1;
  min-width: 0;
  overflow: hidden;
}

.dt-version-display {
  position: fixed;
  left: 0;
  bottom: 8px;
  width: 236px;
  pointer-events: none;
  z-index: 20;
}

.dt-version-display .bf-field-display {
  border: none;
  background: transparent;
  padding: 0 14px;
  font-size: 11px;
  color: var(--dt-muted);
  text-align: right;
  user-select: none;
}

.dt-sidebar [data-block-id="ui.table-menu"],
.dt-sidebar .bf-vertical-menu {
  width: 100%;
}

.dt-sidebar .bf-vertical-menu {
  align-self: stretch;
  background: transparent;
  border: 0;
  padding-bottom: 28px;
}

.dt-sidebar .bf-menu-item {
  border-radius: 6px;
  color: var(--dt-text);
  padding: 9px 10px;
}

.dt-sidebar .bf-menu-item:hover,
.dt-sidebar .bf-menu-item--active {
  background: #f2f4f7;
  color: #111827;
}

.dt-sidebar-head {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  margin-bottom: 12px;
}

.dt-brand {
  font-weight: 700;
  letter-spacing: 0;
}

/* Remove field-block margin so the brand text aligns vertically with the icon buttons */
.dt-sidebar-head .bf-field {
  margin: 0;
  display: flex;
  align-items: center;
}

.dt-nav {
  display: grid;
  gap: 4px;
}

.dt-nav-item {
  border: 0;
  border-radius: 6px;
  padding: 9px 10px;
  background: transparent;
  color: #d7dde8;
  text-align: left;
  cursor: pointer;
}

.dt-nav-item:hover,
.dt-nav-item.is-active {
  background: rgba(255,255,255,0.11);
  color: #fff;
}

.dt-main {
  min-width: 0;
  padding: 18px;
  flex: 1;
  position: relative;
}

.dt-main .bf-field-display,
.dt-sidebar .bf-field-display,
.dt-app-header .bf-field-display {
  border: 0;
  background: transparent;
  padding: 0;
  min-height: 0;
}

.dt-dynamic-actions {
  position: absolute;
  top: 53px;
  right: 18px;
  z-index: 2;
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  pointer-events: auto;
}

.dt-main .bf-controls {
  padding-right: 190px;
}

.dt-main-panel,
.dt-body {
  align-items: stretch;
}

.dt-toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
}

.dt-toolbar h1 {
  font-size: 22px;
  margin: 0 auto 0 0;
}

.dt-search {
  width: 220px;
  height: 34px;
  padding: 0 10px;
  border: 1px solid var(--dt-border);
  border-radius: 6px;
}

.dt-table-wrap {
  overflow: auto;
  background: var(--dt-panel);
  border: 1px solid var(--dt-border);
  border-radius: 8px;
}

.dt-form-buttons {
  justify-content: flex-end;
  gap: 8px;
  margin-top: 16px;
}

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

.dt-table th,
.dt-table td {
  border-bottom: 1px solid var(--dt-border);
  padding: 8px;
  text-align: left;
  vertical-align: middle;
}

.dt-table th {
  background: #eef2f7;
  color: #344054;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

.dt-table td input,
.dt-table td select {
  width: 100%;
  height: 32px;
  box-sizing: border-box;
  border: 1px solid transparent;
  border-radius: 5px;
  background: transparent;
  padding: 0 7px;
}

/* Hide the empty alignment spacer on leaf items — branch toggles (▼/▶) are not empty so stay visible */
.dt-sidebar .bf-menu-toggle:empty {
  display: none;
}

/* Legacy non-editable-div path — keep transparent */
.dt-main .bf-list-cell-input {
  border-color: transparent;
  box-shadow: none;
}

.bf-list-detail-btn {
  color: var(--dt-muted);
}

.bf-list-detail-btn:hover {
  background: var(--dt-accent-soft);
  color: var(--dt-accent);
}

.dt-table td input:focus,
.dt-table td select:focus {
  outline: none;
  border-color: #c8cdd5;
  background: #f7f9fc;
}

.dt-icon-btn {
  width: 30px;
  height: 30px;
  border: 1px solid var(--dt-border);
  border-radius: 6px;
  background: var(--dt-panel);
  color: var(--dt-text);
  cursor: pointer;
}

.dt-sidebar .dt-icon-btn {
  border-color: var(--dt-border);
  background: #fff;
  color: var(--dt-text);
}

.dt-status,
.dt-error {
  margin-bottom: 10px;
  padding: 10px 12px;
  border-radius: 6px;
}

.dt-status {
  background: #eef2f7;
  color: var(--dt-muted);
}

.dt-error {
  background: #fef3f2;
  color: var(--dt-danger);
}

@media (max-width: 760px) {
  .dt-body {
    flex-direction: column;
  }

  .dt-sidebar {
    min-height: auto;
    width: 100%;
  }

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

  .dt-toolbar h1,
  .dt-search {
    width: 100%;
  }

  .dt-dynamic-actions {
    position: static;
    margin-bottom: 10px;
  }

  .dt-main .bf-controls {
    padding-right: 0;
  }
}
