.telegramPage {
  max-width: 980px;
  margin: 0 auto;
}

.tg-card {
  background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
  border: 1px solid #dbe7f5;
  border-radius: 14px;
  padding: 14px;
  margin-bottom: 12px;
  box-shadow: 0 8px 26px rgba(15, 23, 42, 0.06);
}

.tg-card h2,
.tg-card h3 {
  margin: 0 0 10px;
}

.tg-muted {
  color: #64748b;
  font-size: 13px;
  margin: 0 0 10px;
}

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

.tg-span-2 {
  grid-column: span 2;
}

.tg-grid label {
  display: block;
  margin-bottom: 4px;
  font-size: 12px;
  color: #334155;
}

.tg-grid input,
.tg-grid select,
.tg-grid textarea {
  width: 100%;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  padding: 8px;
  font-size: 13px;
}

.tg-actions {
  margin-top: 10px;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.tg-actions button {
  border: 1px solid #0284c7;
  background: #0ea5e9;
  color: #fff;
  border-radius: 8px;
  padding: 8px 12px;
  font-weight: 700;
  cursor: pointer;
}

.tg-actions .tg-btn-ghost {
  background: #fff;
  color: #0369a1;
}

.tg-inline-with-btn {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  align-items: center;
}

.tg-status {
  margin-top: 10px;
  font-size: 13px;
  color: #0f172a;
}

.tg-table-wrap table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.tg-map-table-wrap {
  max-height: 420px;
  overflow-y: auto;
}

.tg-mem-bar {
  width: 100%;
  height: 16px;
  border-radius: 999px;
  background: #e8eef7;
  overflow: hidden;
  border: 1px solid #d3dfef;
}

.tg-mem-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, #22c55e, #f59e0b, #ef4444);
  transition: width 0.25s ease;
}

.tg-mem-bar-fill.is-warning {
  background: linear-gradient(90deg, #f59e0b, #f97316);
}

.tg-mem-bar-fill.is-danger {
  background: linear-gradient(90deg, #ef4444, #b91c1c);
}

.tg-mem-alert {
  margin-top: 8px;
  font-size: 12px;
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid #f59e0b;
  background: #fffbeb;
  color: #92400e;
}

.tg-mem-kpis {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.tg-mem-kpi {
  border: 1px solid #dbe7f5;
  background: #ffffff;
  border-radius: 12px;
  padding: 10px;
}

.tg-mem-kpi-label {
  font-size: 12px;
  color: #64748b;
}

.tg-mem-kpi-value {
  margin-top: 4px;
  font-size: 18px;
  font-weight: 700;
  color: #0f172a;
}

.tg-mem-kpi-value.is-warning {
  color: #b45309;
}

.tg-mem-kpi-value.is-danger {
  color: #b91c1c;
}

.tg-break-row {
  min-width: 120px;
}

.tg-break-bar {
  height: 10px;
  background: #e5edf8;
  border-radius: 999px;
  overflow: hidden;
}

.tg-break-fill {
  height: 100%;
  background: linear-gradient(90deg, #0ea5e9, #0284c7);
}

.tg-table-wrap th,
.tg-table-wrap td {
  border-bottom: 1px solid #e2e8f0;
  padding: 8px 6px;
  text-align: left;
}

.tg-pick-chat {
  border: 1px solid #0ea5e9;
  background: #f0f9ff;
  color: #075985;
  border-radius: 6px;
  padding: 4px 8px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 700;
}

.tg-retry-failed {
  border: 1px solid #f59e0b;
  background: #fffbeb;
  color: #92400e;
  border-radius: 6px;
  padding: 4px 8px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 700;
}

.tg-help {
  margin: 0;
  padding-left: 20px;
}

.tg-help li {
  margin-bottom: 6px;
  font-size: 13px;
}

.tg-tabs {
  display: flex;
  gap: 8px;
  margin-top: 10px;
}

.tg-tab-btn {
  border: 1px solid #cbd5e1;
  background: #fff;
  color: #0f172a;
  border-radius: 8px;
  padding: 8px 12px;
  font-weight: 700;
  cursor: pointer;
}

.tg-tab-btn.is-active {
  border-color: #0284c7;
  background: #e0f2fe;
  color: #075985;
}

.tg-gen-report-multiselect {
  width: 100%;
  min-height: 200px;
  padding: 8px;
  border-radius: 10px;
  border: 1px solid #cbd5e1;
  background: #fff;
  font-size: 13px;
}

@media (max-width: 768px) {
  .tg-grid {
    grid-template-columns: 1fr;
  }

  .tg-span-2 {
    grid-column: auto;
  }

  .tg-mem-kpis {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
