body {
  background: #f7fafc;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  margin: 0;
  min-height: 100vh;
}
.sidebar {
  background: #fff;
  border-right: 1px solid #e2e8f0;
  min-width: 220px;
  max-width: 220px;
  height: 100vh;
  position: fixed;
  top: 0;
  left: 0;
  display: flex;
  flex-direction: column;
  padding: 2rem 1rem 1rem 1.5rem;
  z-index: 100;
}
.sidebar .logo {
  font-size: 1.7rem;
  font-weight: 700;
  margin-bottom: 2.5rem;
  color: #1a2634;
}
.sidebar .nav-link {
  color: #2d3748;
  font-weight: 500;
  border-radius: 8px;
  margin-bottom: 0.5rem;
  padding: 0.7rem 1rem;
  transition: background 0.2s, color 0.2s;
}
.sidebar .nav-link.active, .sidebar .nav-link:hover {
  background: #4a90e2;
  color: #fff;
}
.main-content {
  margin-left: 220px;
  padding: 2.5rem 2rem 2rem 2rem;
  min-height: 100vh;
  background: #f7fafc;
}
.top-bar {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  margin-bottom: 2rem;
}
.user-info {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}
.user-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: #4a90e2;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-weight: 600;
  font-size: 1.1rem;
}
.status-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #38d39f;
  margin-right: 0.5rem;
  border: 2px solid #fff;
  box-shadow: 0 0 0 2px #e2e8f0;
}
.dashboard-title {
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: 0.25rem;
  color: #1a2634;
}
.dashboard-desc {
  color: #718096;
  margin-bottom: 2rem;
}
.stat-cards {
  display: flex;
  gap: 1.5rem;
  margin-bottom: 2rem;
  flex-wrap: wrap;
}
.stat-card {
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.04);
  padding: 1.5rem 2rem;
  flex: 1 1 180px;
  min-width: 180px;
  text-align: left;
  border: 1px solid #e2e8f0;
}
.stat-card .stat-label {
  color: #718096;
  font-size: 1rem;
  margin-bottom: 0.5rem;
}
.stat-card .stat-value {
  font-size: 2rem;
  font-weight: 700;
  color: #1a2634;
}
.quick-actions {
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.04);
  padding: 1.5rem 2rem;
  margin-bottom: 2rem;
  border: 1px solid #e2e8f0;
}
.quick-actions .btn {
  margin-right: 0.75rem;
  margin-bottom: 0.5rem;
}
.charts-row {
  display: flex;
  gap: 1.5rem;
  flex-wrap: wrap;
}
.chart-card {
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.04);
  padding: 1.5rem 2rem;
  flex: 1 1 320px;
  min-width: 320px;
  border: 1px solid #e2e8f0;
}
@media (max-width: 900px) {
  .toggleSidebar {
    display: none !important;
  }
  .main-content {
    margin-left: 0;
    padding: 1rem;
  }
  .sidebar {
    position: static;
    min-width: 100%;
    max-width: 100%;
    height: auto;
    flex-direction: row;
    border-right: none;
    border-bottom: 1px solid #e2e8f0;
    padding: 1rem;
  }
  .stat-cards, .charts-row {
    flex-direction: column;
    gap: 1rem;
  }
}

/* --- Dashboard v2 Redesign Styles --- */
.dashboard-layout {
  min-height: 100vh;
  background: #f7fafc;
}
/* Desktop/web */
.sidebar-v2 {
  background: #fff;
  border-right: 1px solid #e2e8f0;
  width: 240px;
  max-width: 240px;
  /* height: 100vh; */
  position: sticky;
  top: 0;
  left: 0;
  z-index: 101;
}
.nav-link-v2 {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  color: #222;
  font-weight: 500;
  border-radius: 8px;
  margin-bottom: 0.3rem;
  padding: 0.7rem 1rem;
  transition: background 0.2s, color 0.2s;
  text-decoration: none;
  font-size: 1.08rem;
}
.nav-link-v2.active, .nav-link-v2:hover {
  background: #2563eb;
  color: #fff;
}
.nav-link-v2 i {
  font-size: 1.25rem;
}
.main-content-v2 {
  background: #f7fafc;
  min-height: 100vh;
  width: 100%;
  display: flex;
  flex-direction: column;
}
.top-bar-v2 {
  min-height: 64px;
  border-bottom: 1px solid #ececec;
  background: #fff;
  position: sticky;
  top: 0;
  z-index: 102;
}
.btn-icon {
  padding: 0.4rem;
  font-size: 1.3rem;
  line-height: 1;
  width: 36px;
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
}
.dashboard-title-v2 {
  font-size: 2.1rem;
  font-weight: 700;
  color: #1a2634;
  margin-bottom: 0.1rem;
}
.dashboard-desc-v2 {
  color: #718096;
  margin-bottom: 2.2rem;
  font-size: 1.13rem;
}
.stat-card-v2 {
  background: #fff;
  border-radius: 14px;
  box-shadow: 0 2px 12px rgba(0,0,0,0.04);
  padding: 1.5rem 1.5rem 1.1rem 1.5rem;
  border: 1px solid #ececec;
  min-height: 120px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.stat-label-v2 {
  color: #718096;
  font-size: 1.01rem;
  font-weight: 600;
}
.stat-value-v2 {
  font-size: 2.1rem;
  font-weight: 700;
  color: #1a2634;
  margin-bottom: 0.1rem;
}
.stat-subtext-v2 {
  font-size: 0.98rem;
  margin-top: 0.1rem;
}
.quick-actions-v2 {
  border-radius: 14px;
  border: 1px solid #ececec;
  box-shadow: 0 2px 12px rgba(0,0,0,0.04);
  background: #fff;
}
.chart-card-v2 {
  border-radius: 14px;
  border: 1px solid #ececec;
  box-shadow: 0 2px 12px rgba(0,0,0,0.04);
  background: #fff;
}

.sidebar-v2.collapsed {
  width: 60px !important;
  overflow: hidden;
}

.sidebar-v2.collapsed img {
  margin: 0 auto;
}

/* Hide text in nav-link-v2 when collapsed */
.sidebar-v2.collapsed .nav-link-v2 {
  justify-content: center;
}

.sidebar-v2.collapsed .nav-link-v2 i {
  font-size: 1.2rem;
}

.sidebar-v2.collapsed .nav-link-v2 span,
.sidebar-v2.collapsed .nav-link-v2::after {
  display: none;
}

/* Hide brand text */
.sidebar-v2.collapsed .fw-bold {
  display: none;
}

/* Mobile/tablet */
@media (max-width: 900px) {
  .sidebar-v2 {
    position: fixed;
    left: 0;
    top: 0;
    height: 100vh;
    width: 80vw;
    max-width: 320px;
    min-width: 220px;
    z-index: 2000;
    background: #fff;
    transform: translateX(-100%);
    transition: transform 0.3s cubic-bezier(0.4,0,0.2,1);
    box-shadow: 2px 0 16px rgba(0,0,0,0.08);
    border-right: 1px solid #e2e8f0;
    border-bottom: none;
    flex-direction: column;
    padding: 2rem 1rem 1rem 1.5rem;
  }
  .sidebar-v2.open {
    transform: translateX(0);
  }
  .sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0,0,0,0.25);
    z-index: 1999;
  }
  .sidebar-overlay.active {
    display: block;
  }
  .dashboard-layout {
    flex-direction: column;
  }
  .main-content-v2 {
    padding: 0.5rem;
    margin-left: 0 !important;
  }
} 

.upload-tasks-container {
    background: #fff;
    border-radius: 18px;
    padding: 2.5rem 2rem 2rem 2rem;
    box-shadow: none;
    border: 1px solid #f0f1f3;
    margin-top: 1.5rem;
  }
  .upload-tabs {
    display: flex;
    border: none;
    margin-bottom: 2rem;
    background: #f5f6fa;
    border-radius: 12px;
    overflow: hidden;
  }
  .upload-tabs .nav-link {
    flex: 1 1 0;
    text-align: center;
    font-size: 1.15rem;
    font-weight: 500;
    border: none;
    border-radius: 0;
    background: #f5f6fa;
    color: #222;
    padding: 1rem 0;
    transition: background 0.2s, color 0.2s;
  }
  .upload-tabs .nav-link.active {
    background: #2563eb;
    color: #fff;
    border-radius: 0.5rem;
  }
  .upload-form-label {
    font-weight: 500;
    margin-bottom: 0.5rem;
  }
  .upload-form-row {
    gap: 1.5rem;
    margin-bottom: 1.5rem;
  }
  .upload-form-control, .upload-form-select {
    border-radius: 8px;
    border: 1px solid #e5e7eb;
    font-size: 1rem;
    padding: 0.75rem 1rem;
    background: #fafbfc;
    box-shadow: none;
    transition: border 0.2s;
  }
  .upload-form-control:focus, .upload-form-select:focus {
    border-color: #2563eb;
    background: #fff;
    outline: none;
  }
  .upload-form-textarea {
    min-height: 110px;
    resize: vertical;
  }
  .upload-form-footer {
    display: flex;
    justify-content: flex-end;
    margin-top: 1.5rem;
  }
  .upload-btn {
    background: #111;
    color: #fff;
    border-radius: 8px;
    padding: 0.75rem 2rem;
    font-size: 1rem;
    font-weight: 500;
    border: none;
    transition: background 0.2s;
  }
  .upload-btn:hover {
    background: #222;
  }
  @media (max-width: 900px) {
    .upload-tasks-container { padding: 1.2rem; }
    .upload-form-row { flex-direction: column; gap: 1rem; }
  }

  .tasks-main-card {
    background: #fff;
    border-radius: 18px;
    box-shadow: 0 2px 16px rgba(0,0,0,0.04);
    padding: 2.5rem 2.5rem 2rem 2.5rem;
    border: 1px solid #ececec;
    margin-top: 2.5rem;
  }
  .tasks-header-v2 {
    font-size: 2.1rem;
    font-weight: 700;
    color: #1a2634;
    margin-bottom: 0.1rem;
  }
  .tasks-desc-v2 {
    color: #718096;
    margin-bottom: 2.2rem;
    font-size: 1.13rem;
  }
  .tasks-table th, .tasks-table td {
    vertical-align: middle;
    font-size: 1rem;
    background: #fff;
  }
  .tasks-table th {
    color: #718096;
    font-weight: 600;
    background: #fafbfc;
    border-bottom: 2px solid #ececec;
  }
  .tasks-table td {
    border-bottom: 1px solid #f1f1f1;
  }
  .task-title {
    font-weight: 600;
    color: #222;
    font-size: 1.08rem;
  }
  .task-desc {
    color: #a0aec0;
    font-size: 0.97rem;
    margin-bottom: 0.1rem;
  }
  .task-meta {
    color: #b5b5b5;
    font-size: 0.92rem;
  }
  .badge-status {
    font-size: 0.98rem;
    font-weight: 500;
    padding: 0.45em 1.1em;
    border-radius: 1em;
    display: inline-flex;
    align-items: center;
    gap: 0.4em;
  }
  .badge-completed {
    background: #e6f9ed;
    color: #1fa971;
    border: 1px solid #b6f0d2;
  }
  .badge-running {
    background: #eaf4ff;
    color: #2176ff;
    border: 1px solid #b3d6ff;
  }
  .badge-failed {
    background: #ffeaea;
    color: #e14d4d;
    border: 1px solid #ffc1c1;
  }
  .badge-pending {
    background: #fff8e1;
    color: #e6b800;
    border: 1px solid #ffe9a7;
  }
  .progress {
    height: 8px;
    border-radius: 6px;
    background: #f1f3f6;
  }
  .progress-bar {
    background: #2563eb;
  }
  .table-responsive {
    margin-top: 1.5rem;
  }
  .tasks-table .form-check-input {
    margin-top: 0;
  }
  .tasks-table .ri-more-2-fill {
    font-size: 1.3rem;
    color: #b5b5b5;
    cursor: pointer;
  }
  @media (max-width: 900px) {
    .tasks-main-card {
      padding: 1rem 0.5rem;
    }
    .tasks-header-v2 {
      font-size: 1.5rem;
    }
  }

  #stripe-card-element {
    margin-bottom: 1rem;
    padding: 10px;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    background: #ffffff;
  }
  
  /* Usage Log Styles */
  #usage-log {
    margin-top: 1rem;
  }

  #usageChart {
    max-height: 300px;
    width: 100%;
    margin-bottom: 1.5rem;
  }
  
  #usage-log-list {
    list-style: none;
    padding: 0;
    margin: 0;
  }
  
  #usage-log-list li {
    padding: 0.75rem 0;
    border-bottom: 1px solid #e2e8f0;
    font-size: 0.9rem;
    color: #4a5568;
    display: flex;
    align-items: center;
    justify-content: space-between;
  }
  
  #usage-log-list li:last-child {
    border-bottom: none;
  }
  
  #usage-log-list li:before {
    content: '';
    width: 6px;
    height: 6px;
    background: #4a90e2;
    border-radius: 50%;
    margin-right: 0.75rem;
    flex-shrink: 0;
  }
  
  .usage-date {
    color: #718096;
    font-size: 0.8rem;
  }
  
  .usage-type {
    font-weight: 500;
    color: #2d3748;
  }

  @media (max-width: 768px) {
    .table-responsive#apiKeysTable {
      overflow-x: auto !important;
    }
  }

  .table-responsive#apiKeysTable {
    overflow-x: visible;
  }

.info-card-relative {
  position: relative;
  overflow: hidden;
}

.info-card-img {
  position: absolute;
  bottom: -5.5rem;
  right: -3rem;
  height: 330px;
  opacity: 0.12;
  pointer-events: none;
  z-index: 0;
}

.info-card-relative > *:not(.info-card-img) {
  position: relative;
  z-index: 1;
}

#loader-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(255,255,255,0.96);
  z-index: 5000;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.3s;
}
.circle-wave-loader {
  position: relative;
  width: 120px;
  height: 120px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.circle-wave-loader .center-circle {
  width: 48px;
  height: 48px;
  background: radial-gradient(circle at 60% 40%, #2463eb 70%, #2463eb 100%);
  border-radius: 50%;
  z-index: 2;
  box-shadow: 0 2px 24px 0 #2463eb70;
}
.circle-wave-loader .wave {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 96px;
  height: 96px;
  background: radial-gradient(circle,#e0e0e0 40%, #f35be622 100%);
  border-radius: 50%;
  transform: translate(-50%, -50%) scale(1);
  opacity: 0.7;
  animation: wavePulse 1.2s infinite cubic-bezier(0.4,0,0.2,1);
  z-index: 1;
}
@keyframes wavePulse {
  0% {
    transform: translate(-50%, -50%) scale(0.7);
    opacity: 0.8;
  }
  70% {
    transform: translate(-50%, -50%) scale(1.15);
    opacity: 0.2;
  }
  100% {
    transform: translate(-50%, -50%) scale(0.7);
    opacity: 0.8;
  }
}

.text-truncate-task {
  max-width: 100px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: block;
}

/* Minimalistic code block styles for documentation */
pre, code {
  font-family: 'Fira Mono', 'Menlo', 'Monaco', 'Consolas', monospace;
  font-size: 1rem;
  background: none;
  color: inherit;
}

pre {
  background: #f8f9fa;
  border: 1px solid #ececec;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(36,99,235,0.04);
  padding: 1.1rem 1.5rem;
  margin-bottom: 1.5rem;
  overflow-x: auto;
  position: relative;
  transition: box-shadow 0.2s, border 0.2s;
  line-height: 1.6;
  color: #222;
  animation: fadeInCode 0.6s cubic-bezier(0.4,0,0.2,1);
}

@keyframes fadeInCode {
  0% { opacity: 0; transform: translateY(10px) scale(0.98);}
  100% { opacity: 1; transform: translateY(0) scale(1);}
}

/* Optional: language label */
.code-label {
  position: absolute;
  top: 0.5rem;
  right: 1.1rem;
  background: #ececec;
  color: #888;
  font-size: 0.82rem;
  font-weight: 500;
  padding: 0.12em 0.7em;
  border-radius: 5px;
  text-transform: uppercase;
  letter-spacing: 0.01em;
  pointer-events: none;
  opacity: 0.85;
}

/* Optional: copy button */
.copy-btn {
  position: absolute;
  top: 0.5rem;
  left: 1.1rem;
  background: transparent;
  color: #aaa;
  border: none;
  border-radius: 4px;
  font-size: 0.95rem;
  padding: 0.12em 0.6em;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
  opacity: 0.7;
}
.copy-btn:hover {
  background: #ececec;
  color: #222;
  opacity: 1;
}

/* --- Documentation Modern Styles --- */
.code-block {
  background: #23272e;
  border-radius: 8px;
  margin-bottom: 2.2rem;
  box-shadow: 0 2px 8px rgba(0,0,0,0.04);
  overflow: auto;
  position: relative;
}
.code-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.5rem 1rem;
  background: #1a1d23;
  border-top-left-radius: 8px;
  border-top-right-radius: 8px;
}
.code-header .code-header-right {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.code-header .badge {
  font-size: 0.9em;
  padding: 0.3em 0.7em;
}
.copy-btn {
  background: none;
  border: none;
  color: #fff;
  font-size: 0.95em;
  cursor: pointer;
  transition: color 0.2s;
}
.copy-btn:hover {
  color: #00bfae;
}
pre[class*="language-"] {
  margin: 0;
  padding: 1rem;
  background: transparent;
  font-size: 1em;
  border-radius: 0 0 8px 8px;
}
.doc-toc {
  background: #f8f9fa;
  border-radius: 8px;
  padding: 1rem 1.5rem;
  margin-bottom: 2rem;
  box-shadow: 0 1px 4px rgba(0,0,0,0.03);
}
.doc-toc ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  gap: 2rem;
}
.doc-toc li {
  display: inline;
}
.doc-toc a {
  color: #23272e;
  font-weight: 500;
  text-decoration: none;
  transition: color 0.2s;
}
.doc-toc a:hover {
  color: #00bfae;
}
.card h2 i {
  margin-right: 0.5em;
  color: #00bfae;
  vertical-align: middle;
}
@media (max-width: 600px) {
  .doc-toc ul {
    flex-direction: column;
    gap: 0.5rem;
  }
}

html, body {
  max-width: 100vw;
  overflow-x: hidden;
}
.dashboard-layout {
  max-width: 100vw;
  overflow-x: hidden;
}
.main-content-v2 {
  max-width: 100vw;
  overflow-x: hidden;
}
.container-fluid {
  max-width: 100vw;
  overflow-x: hidden;
}
.code-block, .card {
  max-width: 100%;
  overflow-x: auto;
}
pre[class*="language-"] {
  max-width: 100vw;
  overflow-x: auto;
  box-sizing: border-box;
}

.json-get-url {
  display: inline-block;
  margin-top: 0.5em;
  margin-bottom: 0.5em;
  color: #2563eb;
  word-break: break-all;
}

.task-actions-menu {
  background: #fff;
  border: 1px solid #ececec;
  border-radius: 8px;
  box-shadow: 0 2px 12px #0002;
  min-width: 120px;
  padding: 0.25rem 0;
  z-index: 100;
}
.task-actions-menu .dropdown-item {
  font-size: 1rem;
  padding: 0.5rem 1.2rem;
  cursor: pointer;
  border: none;
  background: none;
  width: 100%;
  text-align: left;
}
.task-actions-menu .dropdown-item:hover {
  background: #f5f5f5;
}