  .tg-db-card {
    padding: 16px 20px;
  }

  .tg-db-header {
    margin-bottom: 12px;
  }

  .tg-db-title {
    margin: 0 0 8px 0;
  }

  .tg-db-dbfile-row {
    margin-bottom: 8px;
  }

  .tg-db-dbfile-controls {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    align-items: center;
  }

  .tg-db-dbfile-input {
    max-width: 260px;
  }

  .tg-db-status {
    font-size: 12px;
    margin-top: 4px;
    color: #555;
  }

  .tg-db-layout {
    display: flex;
    gap: 16px;
    align-items: stretch;
  }

  .tg-db-sidebar {
    flex: 0 0 230px;
    border-right: 1px solid #ddd;
    padding-right: 10px;
  }

  .tg-db-sidebar-header {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-bottom: 10px;
  }

  .tg-db-sidebar-body {
    display: flex;
    flex-direction: column;
    gap: 4px;
  }

  .tg-db-sidebar-title-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 6px;
  }

  .tg-db-sidebar-title {
    font-weight: 600;
  }

  .tg-db-table-select-all {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 12px;
    cursor: pointer;
    user-select: none;
  }

  .tg-db-table-select-all-input {
    margin: 0;
  }

  .tg-db-table-list {
    list-style: none;
    margin: 0;
    padding: 0;
    max-height: 500px;
    overflow: auto;
    border: 1px solid #ddd;
    border-radius: 4px;
  }

  .tg-db-table-item {
    padding: 4px 8px;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 13px;
    gap: 4px;
  }

  .tg-db-table-item-left {
    display: flex;
    align-items: center;
    gap: 4px;
    min-width: 0;
  }

  .tg-db-table-checkbox {
    flex: 0 0 auto;
  }

  .tg-db-table-item-name {
    flex: 1 1 auto;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .tg-db-table-item:nth-child(odd) {
    background: #262c4b;
  }

  .tg-db-table-item.is-active {
    background: #41457d;
    font-weight: 600;
  }

  .tg-db-table-item-type {
    opacity: 0.7;
    flex: 0 0 auto;
  }

  .tg-db-main {
    flex: 1 1 auto;
    min-width: 0;
  }

  .tg-db-tabs {
    display: flex;
    gap: 4px;
    margin-bottom: 8px;
  }


  
  .tg-db-tab-btn {
    border: 1px solid #1d1f2d;
    background: #5957af;
    padding: 4px 10px;
    border-radius: 4px 4px 0 0;
    cursor: pointer;
    font-size: 13px;
    color:#fff;
  }

  .tg-db-tab-btn.is-active {
    background: #292863;
    border-bottom-color: #49537f;
    font-weight: 600;
  }

  .tg-db-tabs-body {
    border: 1px solid #ccc;
    border-radius: 0 4px 4px 4px;
    padding: 10px;
    background: #1c2137;
  }

  .tg-db-tab-panel {
    display: none;
  }

  .tg-db-tab-panel.is-active {
    display: block;
  }

  .tg-db-panel-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 8px;
  }

  .tg-db-panel-title {
    font-weight: 600;
  }

  .tg-db-panel-subtitle {
    font-size: 12px;
    opacity: 0.8;
  }

  .tg-db-panel-body {
    display: block;
  }

  .tg-db-table-wrapper {
    max-height: 420px;
    overflow: auto;
    border: 1px solid #2b3357
    border-radius: 4px;
  }

  .tg-db-table-wrapper table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
  }

  .tg-db-table-wrapper th,
  .tg-db-table-wrapper td {
    border: 1px solid #302d55;
    padding: 4px 6px;
  }

  .tg-db-table-wrapper th {
    background: #3e4175;
    position: sticky;
    top: 0;
    z-index: 1;
  }

  .tg-db-data-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    margin-bottom: 6px;
  }

  .tg-db-data-limit-label {
    font-size: 12px;
    display: flex;
    align-items: center;
    gap: 4px;
  }

  .tg-db-data-limit {
    max-width: 90px;
  }

  .tg-db-data-search {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-wrap: wrap;
  }

  .tg-db-data-search-input {
    max-width: 220px;
  }

  .tg-db-data-add-form {
    margin-top: 10px;
    border-top: 1px dashed #ddd;
    padding-top: 8px;
  }

  .tg-db-data-add-form-row {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 6px;
  }

  .tg-db-data-add-form-row label {
    font-size: 12px;
  }

  .tg-db-data-actions {
    white-space: nowrap;
  }

  .tg-db-data-pager {
    display: none;
    margin-top: 6px;
    margin-bottom: 6px;
    align-items: center;
    gap: 6px;
    font-size: 12px;
  }

  .tg-db-data-page-info {
    opacity: 0.8;
  }

  .tg-db-data-replace-panel {
    display: none;
    margin: 6px 0 8px;
    padding: 6px;
    background: #272a51;
    border-radius: 4px;
    border: 1px dashed #ddd;
  }

  .tg-db-data-replace-panel.is-open {
    display: block;
  }

  .tg-db-data-replace-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    margin-bottom: 4px;
  }

  .tg-db-data-replace-input {
    max-width: 200px;
  }

  .tg-db-data-replace-hint {
    font-size: 11px;
    opacity: 0.8;
  }

  .tg-db-sql-layout {
    display: flex;
    gap: 10px;
    margin-top: 10px;
  }

  .tg-db-sql-result {
    flex: 2 1 auto;
    min-width: 0;
  }

  .tg-db-sql-log {
    flex: 1 0 180px;
    border: 1px solid #eee;
    border-radius: 4px;
    max-height: 320px;
    overflow: auto;
    font-size: 12px;
  }

  .tg-db-sql-result-title,
  .tg-db-sql-log-title {
    font-weight: 600;
    margin-bottom: 4px;
  }

  .tg-db-sql-log-body {
    padding: 4px 6px;
    white-space: pre-wrap;
  }

  .tg-db-sql-log-line {
    margin-bottom: 4px;
    border-bottom: 1px dashed #eee;
    padding-bottom: 2px;
  }

  .tg-db-modal {
    position: fixed;
    inset: 0;
    display: none;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.35);
    z-index: 1000;
  }

  .tg-db-modal.is-open {
    display: flex;
  }

  .tg-db-modal-dialog {
    background: #232843;
    padding: 16px 20px;
    border-radius: 6px;
    max-width: 720px;
    width: 100%;
    max-height: 90vh;
    overflow: auto;
  }

  .tg-db-modal-title {
    margin-top: 0;
    margin-bottom: 10px;
  }

  .tg-db-modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    margin-top: 10px;
  }

  .tg-db-create-columns-table th,
  .tg-db-create-columns-table td {
    padding: 4px 6px;
    font-size: 13px;
  }

  .tg-db-cell-input {
    width: 100%;
    font-size: 13px;
  }

  /* Мобильная адаптация */
  @media (max-width: 768px) {
    .tg-db-card {
      padding: 12px 10px;
    }

    .tg-db-layout {
      flex-direction: column;
    }

    .tg-db-sidebar {
      flex: 1 1 auto;
      border-right: none;
      border-bottom: 1px solid #ddd;
      padding-right: 0;
      padding-bottom: 10px;
    }

    .tg-db-table-list {
      max-height: 260px;
    }

    .tg-db-main {
      width: 100%;
    }

    .tg-db-data-toolbar {
      flex-direction: column;
      align-items: stretch;
    }

    .tg-db-data-limit-label {
      width: 100%;
      justify-content: space-between;
    }

    .tg-db-data-search {
      width: 100%;
    }

    .tg-db-data-search-input {
      max-width: 100%;
      width: 100%;
    }

    .tg-db-data-replace-row {
      flex-direction: column;
      align-items: stretch;
    }

    .tg-db-data-replace-input {
      max-width: 100%;
      width: 100%;
    }

    .tg-db-sql-layout {
      flex-direction: column;
    }

    .tg-db-sql-log {
      max-height: 200px;
    }

    .tg-db-modal-dialog {
      max-width: 100%;
      margin: 0 8px;
    }
  }