/* ===================================================== */
/*                    Светлая тема                       */
/* ===================================================== */

html[data-theme="light"] .tg-bots-card {
  border-color: #e5e7eb;
  background: radial-gradient(circle at top left, #ffffff, #eef2ff 60%);
  box-shadow: 0 16px 40px rgba(15, 23, 42, 0.08);
}

html[data-theme="light"] .tg-bots-title {
  color: #111827;
}

html[data-theme="light"] .tg-bots-subtitle {
  color: #6b7280;
}

html[data-theme="light"] .tg-bots-tariff-info {
  background: #f3f4ff;
  border-color: #e5e7eb;
}

html[data-theme="light"] .tg-bots-tariff-title {
  color: #4b5563;
}

html[data-theme="light"] .tg-bots-tariff-grid {
  color: #374151;
}

/* Инпуты формы в светлой теме */
html[data-theme="light"] .tg-bots-card .form-input,
html[data-theme="light"] .tg-bots-card .form-textarea {
  background: #ffffff;
  border-color: #d1d5db;
  color: #111827;
}

html[data-theme="light"] .tg-bots-card .form-input::placeholder,
html[data-theme="light"] .tg-bots-card .form-textarea::placeholder {
  color: #9ca3af;
}

html[data-theme="light"] .tg-bots-card .form-input:focus,
html[data-theme="light"] .tg-bots-card .form-textarea:focus {
  border-color: #4f46e5;
  box-shadow: 0 0 0 1px rgba(79, 70, 229, 0.35);
}

/* Блок файлов справа */
html[data-theme="light"] .form-section--files {
  background: #f9fafb;
  border-color: #e5e7eb;
}

/* Мини-компонент файлов */
html[data-theme="light"] .tg-bot-file-row {
  background: #f9fafb;
  border-color: #e5e7eb;
}

/* Блок "Мои боты" */
html[data-theme="light"] .tg-bots-hosting-summary {
  background: #f9fafb;
  border-color: #e5e7eb;
  color: #111827;
}

/* Мета-инфо бота в светлой теме */
html[data-theme="light"] .tg-bot-meta-label {
  color: #6b7280;
}

html[data-theme="light"] .tg-bot-meta-value {
  color: #111827;
}

/* Логин-ссылка в светлой теме */
html[data-theme="light"] .tg-bot-login-link {
  color: #4f46e5;
}

html[data-theme="light"] .tg-bot-login-link:hover {
  color: #312e81;
}

/* Структурированный блок "Мои боты" — светлая тема */
html[data-theme="light"] .tg-hosting-label {
  color: #6b7280;
}

html[data-theme="light"] .tg-hosting-value {
  color: #111827;
}

html[data-theme="light"] .tg-hosting-stat--danger .tg-hosting-label {
  color: #b45309;
}

html[data-theme="light"] .tg-hosting-stat--danger .tg-hosting-value {
  color: #b91c1c;
}

html[data-theme="light"] .tg-bot-list {
  border-color: #e5e7eb;
  color: #111827;
}

html[data-theme="light"] .tg-bot-item--collapsible-actions .tg-bot-actions-toggle {
    grid-column: 1 / -1;
    grid-row: auto;
    margin-top: 6px;
    padding: 4px 8px;
    border-radius: 999px;
    border: 0px solid #4b5563;
    background: rgb(15 23 42 / 0%);
    font-size: 11px;
    color: #000000;
    display: inline-flex;
    align-items: center;
    justify-content: space-between;
    gap: 6px;
    cursor: pointer;
}

html[data-theme="light"] .tg-bot-list-title {
  color: #111827;
}

html[data-theme="light"] .tg-bot-list-hint {
  color: #6b7280;
}

/* Файловый менеджер */
html[data-theme="light"] .tg-bot-files-card {
  border-color: #e5e7eb;
  background: radial-gradient(circle at top left, #ffffff, #eef2ff 60%);
  box-shadow: 0 16px 40px rgba(15, 23, 42, 0.08);
}

html[data-theme="light"] .tg-bot-files-title {
  color: #111827;
}

html[data-theme="light"] .tg-bot-files-subtitle {
  color: #6b7280;
}

html[data-theme="light"] .tg-bot-files-bot-meta {
  background: #eff6ff;
  border-color: #bfdbfe;
  color: #111827;
}

html[data-theme="light"] .tg-bot-files-bot-meta-label {
  color: #6b7280;
}

html[data-theme="light"] .tg-bot-files-bot-meta-value {
  color: #111827;
}

html[data-theme="light"] .tg-bot-files-root {
  border: 1px solid #e5e7eb;
  background: linear-gradient(135deg, #f9fafb, #eef2ff);
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.06);
  color: #111827;
}

html[data-theme="light"] .tg-bot-files-header-divider {
  background: #e5e7eb;
}

html[data-theme="light"] .tg-bot-files-crumb {
  background: #e5e7eb;
  color: #111827;
}

html[data-theme="light"] .tg-bot-files-crumb:hover {
  background: rgba(129, 140, 248, 0.13);
  color: #111827;
}

html[data-theme="light"] .tg-bot-files-sidebar {
  border-right: 1px solid #e5e7eb;
}

@media (max-width: 900px) {
  html[data-theme="light"] .tg-bot-files-sidebar {
    border-bottom: 1px solid #e5e7eb;
  }
}

/* Поиск — светлая */
html[data-theme="light"] .tg-bot-files-search {
  border-color: #d1d5db;
  background: #ffffff;
  color: #111827;
}

html[data-theme="light"] .tg-bot-files-search::placeholder {
  color: #9ca3af;
}

/* Список файлов */
html[data-theme="light"] .tg-bot-files-list {
  border-color: #e5e7eb;
  background: #ffffff;
}

/* Drag&drop */
html[data-theme="light"] .tg-bot-files-root--dragover .tg-bot-files-list {
  border-color: #4f46e5;
  background: #eef2ff;
}

html[data-theme="light"] .tg-bot-files-root--dragover .tg-bot-files-list::before {
  color: #4f46e5;
}

/* Строки */
html[data-theme="light"] .tg-bot-files-row:nth-child(odd) {
  background: #ffffff;
}

html[data-theme="light"] .tg-bot-files-row:nth-child(even) {
  background: #f9fafb;
}

html[data-theme="light"] .tg-bot-files-row--header {
  background: #e5e7eb;
  border-bottom-color: #d1d5db;
}

html[data-theme="light"] .tg-bot-files-row-up {
  background: #f3f4ff;
  border-bottom-color: #e5e7eb;
}

html[data-theme="light"] .tg-bot-files-row--active {
  background: #e0e7ff;
  box-shadow: inset 2px 0 0 #4f46e5;
}

html[data-theme="light"] .tg-bot-files-header-cell {
  color: #4b5563;
}

html[data-theme="light"] .tg-bot-files-row-title {
  color: #111827;
}

html[data-theme="light"] .tg-bot-files-row-subtitle {
  color: #6b7280;
}

/* Теги */
html[data-theme="light"] .tg-bot-files-tag {
  border-color: #e5e7eb;
  background: #ffffff;
  color: #374151;
}

html[data-theme="light"] .tg-bot-files-tag--dir {
  border-color: #c7d2fe;
  background: #eef2ff;
  color: #3730a3;
}

html[data-theme="light"] .tg-bot-files-tag--file {
  border-color: #e5e7eb;
  color: #374151;
}

/* Подсветка поиска */
html[data-theme="light"] .tg-bot-files-search-mark {
  background: #fef3c7;
  color: #92400e;
}

/* Подписи */
html[data-theme="light"] .tg-bot-files-sidebar-footer,
html[data-theme="light"] .tg-bot-file-editor-footer,
html[data-theme="light"] .tg-bot-files-status {
  color: #6b7280;
}

/* Шапка редактора */
html[data-theme="light"] .tg-bot-file-editor-header {
  color: #4b5563;
}

/* CodeMirror — светлая */
html[data-theme="light"] .CodeMirror {
  background: #fdfdfd;
  border-color: #e5e7eb;
  box-shadow: inset 0 0 0 1px rgba(209, 213, 219, 0.5);
  color: #111827;
}

/* Редактор кода в светлой теме */
html[data-theme="light"] .tg-bot-file-editor .CodeMirror {
  min-height: 260px;
  max-height: none;
  resize: vertical;
  overflow: auto;
}

/* Статусы */
html[data-theme="light"] .tg-bot-files-status.is-error {
  color: #b91c1c;
}

html[data-theme="light"] .tg-bot-files-status.is-busy {
  color: #4f46e5;
}

/* Опасные кнопки */
html[data-theme="light"] .tg-bot-files-btn-danger {
  color: #b91c1c;
  border-color: #fecaca;
}

html[data-theme="light"] .tg-bot-files-btn-danger:hover {
  background: #fee2e2;
}

/* Верхняя панель файлов (light) */
html[data-theme="light"] .tg-bot-files-header {
  border-radius: 10px;
  border-bottom: 1px solid #e5e7eb;
  background: linear-gradient(
    90deg,
    rgba(255, 255, 255, 0.95),
    rgba(239, 246, 255, 0.95)
  );
}

html[data-theme="light"] .tg-bot-files-header-left {
  flex: 1 1 auto;
  min-width: 0;
  margin-bottom: 2px;
}

html[data-theme="light"] .tg-bot-files-header-actions {
  flex: 0 0 auto;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

/* Путь */
html[data-theme="light"] .tg-bot-files-path {
  max-width: 100%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

html[data-theme="light"] .tg-bot-files-header-group {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 6px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 0 0 1px rgba(209, 213, 219, 0.7);
}

html[data-theme="light"] .tg-bot-files-header-divider {
  width: 1px;
  height: 28px;
  background: #e5e7eb;
}

/* Кнопки тулбара в светлой теме */
html[data-theme="light"] .tg-bot-files-header-actions .btn-secondary.btn-xs,
html[data-theme="light"] .tg-bot-files-header-actions .tg-bot-files-upload-label {
  border-color: transparent;
  background: transparent;
  padding: 4px 9px;
  font-size: 0.78rem;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: #374151;
}

/* Адаптив верхней панели (light) */
@media (max-width: 900px) {
  html[data-theme="light"] .tg-bot-files-header {
    flex-direction: column;
    align-items: stretch;
    gap: 6px;
  }

  html[data-theme="light"] .tg-bot-files-header-actions {
    justify-content: flex-start;
  }

  html[data-theme="light"] .tg-bot-file-editor-hint {
    display: none;
  }
}

/* Модалка ENV — светлая тема */
html[data-theme="light"] .tg-env-modal-backdrop {
  background: rgba(15, 23, 42, 0.45);
}

html[data-theme="light"] .tg-env-modal-dialog {
  background: #ffffff;
  color: #111827;
  box-shadow: 0 18px 40px rgba(15, 23, 42, 0.15);
}

html[data-theme="light"] .tg-env-modal-title {
  color: #111827;
}

/* Карточка бота в светлой теме */
html[data-theme="light"] .tg-bot-item {
  border-color: #e5e7eb;
  background: radial-gradient(circle at top left, #ffffff, #eef2ff 60%);
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.06);
}

/* Цвета текста в светлой теме */
html[data-theme="light"] .tg-bot-item-title {
  color: #111827;
}

html[data-theme="light"] .tg-bot-item-meta {
  color: #6b7280;
}

html[data-theme="light"] .tg-bot-item-tg-info {
  color: #374151;
}

html[data-theme="light"] .tg-bot-item-hosting {
  color: #4f46e5;
}



html[data-theme="light"] .tg-bots-card .form-label {
  font-size: 13px;
  font-weight: 500;
  color: #353535;
}

html[data-theme="light"] .tg-bots-card .form-help {
  font-size: 12px;
  line-height: 1.5;
  color: #484849;
}

html[data-theme="light"] .tg-bot-rules-agree-text {
    text-decoration: underline;
    color: #2d2d2d;
  }
  
html[data-theme="light"] .tg-bot-balance-link {
    border: none;
    background: none;
    padding: 0;
    margin: 0;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    color: #2d2d2d;
    text-decoration: none;
    text-align:center;
  }
  
html[data-theme="light"] .tg-bot-guest-message {
    margin-top: 8px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 12px;
    border-radius: 12px;
    background: rgb(231 231 231 / 90%);
    border: 1px dashed rgba(75, 85, 99, 0.9);
    font-size: 13px;
    color: #000000;
}

html[data-theme="light"] .tg-edit-modal-dialog {
  position: relative;
  z-index: 1;
  background: #fff;
  border-radius: 12px;
  padding: 20px 24px;
  max-width: 720px;
  width: 100%;
  max-height: 90vh;
  box-shadow: 0 18px 45px rgba(15, 23, 42, 0.35);
  display: flex;
  flex-direction: column;
  box-sizing: border-box;
  overflow: hidden;
  color:#000;
}