/* Bot card grid for Visits by AI Bot section */
.bot-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(max(180px, 100%/5), 1fr));
  gap: 1.5rem;
  padding: 1rem 10px;
  margin-bottom: 10px;
  max-width: 100%;
}

.bot-visit-card {

  border-radius: 14px;
  box-shadow: 0 2px 8px 0 rgba(60, 72, 100, 0.08), 0 1px 2px 0 rgba(60, 72, 100, 0.06);
  min-width: 160px;
  /* max-width: 305px; */
  padding: 18px 18px 14px 18px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  margin-bottom: 8px;
}

.bot-card-header {
  font-size: 1.08rem;
  font-weight: 600;
  color: #2b364a;
  margin-bottom: 8px;
}

.bot-card-name {
  color: #3b4a6b;
  font-weight: 600;
  letter-spacing: 0.01em;
}

.bot-card-count {
  font-size: 1.1rem;
  color: #4a5a7a;
  font-weight: 500;
  margin-bottom: 8px;
}

.bot-card-bar-bg {
  width: 100%;
  height: 8px;
  background: #e3e8f0;
  border-radius: 5px;
  margin-top: 2px;
  overflow: hidden;
}

.bot-card-bar {
  height: 100%;
  border-radius: 5px;
}

.analytics-tab-wrapper {
  padding: 32px;
  background: white;
  border-radius: 12px;
  font-family: -apple-system, BlinkMacOSystemFont, "Segoe UI", Roboto, sans-serif;
  color: #2c3338;
}

/* Header */
.analytics-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 32px;
  flex-wrap: wrap;
  gap: 16px;
}

.analytics-header h2 {
  margin: 0;
  font-size: 22px;
  font-weight: 500;
  color: #2c3338;
}

.controls-group {
  display: flex;
  align-items: center;
  gap: 12px;
}

.select-wrapper {
  position: relative;
}

.select-wrapper select {
  appearance: none;
  background: white;
  border: 1px solid #dcdcde;
  border-radius: 9999px;
  padding: 4px 2px 3px 12px;
  font-size: 13px;
  color: #2c3338;
  cursor: pointer;
  min-width: 120px;
}

.select-wrapper select:focus {
  border-color: #722ed1;
  outline: none;
  box-shadow: 0 0 0 2px rgba(114, 46, 209, 0.15);
}

.select-icon {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: #646970;
  pointer-events: none;
}

.btn-clear {
  background: #722ed1;
  color: white;
  border: none;
  padding: 8px 20px;
  border-radius: 9999px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
}

.btn-clear:hover:not(:disabled) {
  background: #5b24a8;
}

.btn-clear:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* Stat cards ─ very similar to reference */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 20px;
  margin-bottom: 40px;
}

.stat-card {
  background: white;
  border: 1px solid #e5e7eb;
  border-radius: 16px;
  padding: 24px;
  position: relative;
  overflow: hidden;
  transition: all 0.2s ease;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.04);
}

.stat-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.08);
}

.stat-card.purple .stat-icon-bg {
  background: #f3e8ff;
}

.stat-card.blue .stat-icon-bg {
  background: #eff6ff;
}

.stat-card.emerald .stat-icon-bg {
  background: #ecfdf5;
}

.stat-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 16px;
}

.stat-label {
  font-size: 13px;
  font-weight: 600;
  color: #646970;
  letter-spacing: 0.3px;
}

.stat-icon-bg {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.3s ease;
}

.stat-card:hover .stat-icon-bg {
  transform: scale(1.12);
}

.stat-value {
  font-size: 36px;
  font-weight: 700;
  color: #111827;
  line-height: 1;
  margin-bottom: 8px;
}

.stat-footer {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 12px;
  color: #6b7280;
}

.trend-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: #ecfdf5;
  color: #065f46;
  font-weight: 600;
  padding: 2px 10px;
  border-radius: 9999px;
  font-size: 11px;
}

/* Decorative bg circle like in reference */
.stat-card::after {
  content: '';
  position: absolute;
  right: -32px;
  bottom: -32px;
  width: 120px;
  height: 120px;
  background: rgba(114, 46, 209, 0.04);
  border-radius: 50%;
  transition: transform 0.6s ease;
  pointer-events: none;
}

.stat-card:hover::after {
  transform: scale(1.3);
}

/* Bot progress bars */
.section-card {
  background: white;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  padding: 18px;
  margin-bottom: 32px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.table-section h3 {
  margin: 12px 17px !important;

}

.section-card h3 {
  margin: 0 0 20px;
  font-size: 16px;
  font-weight: 600;
  color: #2c3338;
}

.bot-progress-list {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.bot-progress-item {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.bot-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
}

.bot-name {
  font-size: 14px;
  font-weight: 600;
  color: #2c3338;
}

.bot-count {
  font-size: 13px;
  color: #646970;
  font-weight: 500;
}

.progress-bg {
  height: 8px;
  background: #f0f0f1;
  border-radius: 4px;
  overflow: hidden;
}

.progress-bar {
  height: 100%;
  border-radius: 4px;
  transition: width 1s ease;
}

/* Table */
.table-section {
  padding: 0;
  overflow: hidden;
}

.table-container {
  overflow-x: auto;
}

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

thead tr {
  background: #f8f9fa;
}

th {
  text-align: left;
  padding: 14px 20px;
  font-size: 11px;
  font-weight: 700;
  color: #646970;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-bottom: 1px solid #e5e7eb;
}

td {
  padding: 14px 20px;
  font-size: 13px;
  color: #2c3338;
  border-bottom: 1px solid #f0f0f1;
}

.hover-row:hover {
  background: #fcfcfc;
}

.bot-cell {
  display: flex;
  align-items: center;
  gap: 8px;
}

.bot-icon {
  color: #722ed1;
}

.mono-cell {
  font-family: ui-monospace, 'SFMono-Regular', monospace;
  color: #646970;
  font-size: 12.5px;
}

.url-cell {
  color: #2271b1;
  display: flex;
  align-items: center;
  gap: 6px;
  max-width: 320px;
}

.url-cell a {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: #2271b1;
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 6px;
}

.url-cell a:hover {
  color: #135e96;
  text-decoration: underline;
}

.external-icon {
  color: #a7aaad;
  flex-shrink: 0;
}

.time-cell {
  color: #646970;
  white-space: nowrap;
}

.action-cell {
  text-align: right;
}

.delete-btn {
  color: #a7aaad;
  background: none;
  border: none;
  cursor: pointer;
  opacity: 0;
  transition: all 0.2s;
}

.hover-row:hover .delete-btn {
  opacity: 1;
}
.select-wrapper select:disabled {
  background: #f9fafb;
  border-color: #e5e7eb;
  color: #9ca3af;
  cursor: not-allowed;
  background-image: none  !important;
}

.delete-btn:hover {
  color: #d63638;
}

/* Notices & loader */
.notice {
  padding: 12px 16px;
  border-radius: 8px;
  margin-bottom: 24px;
}

.notice.success {
  background: #ecfdf5;
  color: #065f46;
  border: 1px solid #a7f3d0;
}

.notice.error {
  background: #fef2f2;
  color: #991b1b;
  border: 1px solid #fecaca;
}

.loader-container {
  display: flex;
  justify-content: center;
  padding: 100px 0;
}

.no-data-text {
  text-align: center;
  color: #9ca3af;
  font-size: 15px;
  padding: 60px 0;
}

/* Responsive */
@media (max-width: 1024px) {
  .stats-grid {
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  }
}

@media (max-width: 768px) {
  .analytics-header {
    flex-direction: column;
    align-items: stretch;
  }

  .controls-group {
    flex-direction: column;
    gap: 12px;
  }

  .select-wrapper select {
    width: 100%;
  }
}

/* Table Header & Search - Bottom underline only, no box */
.table-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;

}

.search-wrapper {
  display: flex;
  align-items: center;
  gap: 12px;
}

.search-input-container {
     display: flex;
    align-items: center;
    border-bottom: 1px solid #94a3b8;
    width: 250px;
    transition: border-color 0.25s ease;
    margin-right: 1vw
}

.search-input-container:focus-within {
  border-color: #722ed1;
}

.table-search-input {
  border: none !important;
  outline: none !important;
  background: transparent;
  padding: 10px 8px 10px 4px;
  font-size: 15px;
  flex: 1;
  color: #1f2937;
}

.table-search-input:focus {
  box-shadow: none !important;
}

.table-search-input::placeholder {
  color: #9ca3af;
}

.search-icon {
  color: #64748b;
  flex-shrink: 0;
}

.clear-search-btn {
  background: none;
  border: none;
  color: #9ca3af;
  font-size: 20px;
  cursor: pointer;
  padding: 8px 4px;
}

.clear-search-btn:hover {
  color: #ef4444;
}

/* Keep your existing pagination & table styles */

.pagination {
  display: flex;
  justify-content: space-between;
  padding: 15px 1vw;
}

/* Text on LEFT */
.pagination-info {

  display: flex;
  align-items: center;
  justify-content: end;
}

/* Buttons perfectly CENTERED */
.pagination-container {

  display: flex;
  justify-self: center;

}

/* Button styles (unchanged) */
.page-btn {
  padding: 6px 12px;
  border: 1px solid #ddd;
  background: #fff;
  border-radius: 4px;
  cursor: pointer;
}

.page-btn.active {
  background: #722ed1;
  color: #fff;
  border-color: #722ed1;
}

.page-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Mobile - stack everything nicely */
@media (max-width: 640px) {
  .pagination {
    grid-template-columns: 1fr;
    gap: 1rem;
    text-align: center;
  }

  .pagination-info-container,
  .pagination-container {
    display: flex;
    justify-self: end;

  }
}