:root {
  color-scheme: dark;
  --canvas-base: #05070f;
  --canvas-default: #0b1020;
  --canvas-inset: #0e1424;
  --canvas-overlay: #141c30;
  --canvas-emphasis: #1a2440;
  --border-default: #1e2a44;
  --border-muted: #172238;
  --border-subtle: #121a2c;
  --fg-default: #e6edf8;
  --fg-muted: #8b9bb8;
  --fg-subtle: #5b6b88;
  --fg-on-emphasis: #ffffff;
  --accent-fg: #38bdf8;
  --accent-emphasis: #0ea5e9;
  --accent-muted: #38bdf866;
  --accent-subtle: #38bdf81f;
  --success-fg: #34d399;
  --success-emphasis: #10b981;
  --success-muted: #34d39966;
  --success-subtle: #34d3991f;
  --attention-fg: #fbbf24;
  --attention-emphasis: #f59e0b;
  --attention-muted: #fbbf2466;
  --attention-subtle: #fbbf241f;
  --danger-fg: #fb7185;
  --danger-emphasis: #f43f5e;
  --danger-muted: #fb718566;
  --danger-subtle: #fb71851f;
  --done-fg: #a78bfa;
  --done-emphasis: #8b5cf6;
  --done-subtle: #a78bfa1f;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background-color: var(--canvas-base);
  color: var(--fg-default);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  line-height: 1.5;
  background-image: 
    radial-gradient(ellipse 60% 50% at 12% -5%, rgba(56, 189, 248, 0.14), transparent 60%), 
    radial-gradient(ellipse 55% 45% at 92% 0%, rgba(139, 92, 246, 0.12), transparent 55%), 
    radial-gradient(ellipse 70% 60% at 50% 110%, rgba(14, 165, 233, 0.08), transparent 60%), 
    linear-gradient(to right, rgba(56, 189, 248, 0.035) 1px, transparent 1px), 
    linear-gradient(to bottom, rgba(56, 189, 248, 0.035) 1px, transparent 1px);
  background-size: 100% 100%, 100% 100%, 100% 100%, 36px 36px, 36px 36px;
  background-attachment: fixed;
}

a {
  color: inherit;
  text-decoration: none;
}

/* Scrollbar styling */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background-color: #243150;
  border: 2px solid transparent;
  background-clip: content-box;
  border-radius: 9999px;
}

::-webkit-scrollbar-thumb:hover {
  background-color: #2f4068;
}

/* Grid & Layout */
.app-container {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.max-w-container {
  width: 100%;
  max-w: 1200px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* Header */
.app-header {
  border-bottom: 1px solid var(--border-subtle);
  background-color: rgba(11, 16, 32, 0.65);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  position: sticky;
  top: 0;
  z-index: 50;
}

.header-inner {
  height: 4.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.brand-section {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.logo-icon {
  width: 2.25rem;
  height: 2.25rem;
  color: var(--accent-fg);
}

.brand-name {
  font-size: 1.125rem;
  font-weight: 700;
  letter-spacing: -0.025em;
}

.brand-name span {
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--fg-muted);
  margin-left: 0.375rem;
}

.nav-section {
  display: flex;
  align-items: center;
  gap: 1.25rem;
}

/* Main Area */
.main-content {
  flex: 1;
  padding: 3rem 0;
}

/* Card layout & Glassmorphism */
.card {
  background-color: rgba(11, 16, 32, 0.7);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border-default);
  border-radius: 18px;
  overflow: hidden;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.04) inset, 0 8px 30px rgba(0, 0, 0, 0.4);
  transition: all 0.2s ease;
}

/* Verification View (Login) */
.verify-card-wrapper {
  max-width: 480px;
  margin: 4rem auto;
}

.verify-card-header {
  padding: 2rem 2rem 1.5rem;
  text-align: center;
  border-bottom: 1px solid var(--border-subtle);
}

.verify-card-title {
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
}

.verify-card-desc {
  font-size: 0.875rem;
  color: var(--fg-muted);
}

.verify-card-body {
  padding: 2rem;
}

.form-group {
  margin-bottom: 1.5rem;
}

.form-label {
  display: block;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--fg-muted);
  margin-bottom: 0.5rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* Inputs */
.input-base {
  width: 100%;
  border-radius: 14px;
  border: 1px solid var(--border-default);
  padding: 0.75rem 1rem;
  font-size: 0.875rem;
  background-color: var(--canvas-inset);
  color: var(--fg-default);
  transition: all 0.2s ease;
  font-family: inherit;
}

.input-base::placeholder {
  color: var(--fg-subtle);
}

.input-base:focus {
  border-color: var(--accent-fg);
  box-shadow: 0 0 0 4px rgba(56, 189, 248, 0.12), 0 0 24px rgba(56, 189, 248, 0.18);
  outline: none;
}

.input-base:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.textarea-base {
  min-height: 120px;
  resize: vertical;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  border-radius: 14px;
  border: 1px solid transparent;
  padding: 0.625rem 1.25rem;
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  user-select: none;
}

.btn-primary {
  color: var(--fg-on-emphasis);
  background-image: linear-gradient(120deg, #22d3ee, #3b82f6 55%, #8b5cf6);
  box-shadow: 0 4px 16px rgba(14, 165, 233, 0.35);
}

.btn-primary:hover:not(:disabled) {
  filter: brightness(1.1);
  box-shadow: 0 0 18px rgba(56, 189, 248, 0.45);
}

.btn-primary:active:not(:disabled) {
  transform: translateY(1px);
  filter: brightness(0.95);
}

.btn-primary:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  box-shadow: none;
}

.btn-secondary {
  border-color: var(--border-default);
  background-color: var(--canvas-inset);
  color: var(--fg-default);
}

.btn-secondary:hover:not(:disabled) {
  border-color: var(--accent-muted);
  background-color: var(--canvas-overlay);
}

.btn-ghost {
  border-color: transparent;
  background-color: transparent;
  color: var(--fg-muted);
}

.btn-ghost:hover:not(:disabled) {
  background-color: var(--canvas-overlay);
  color: var(--fg-default);
}

.btn-danger {
  border-color: rgba(251, 113, 133, 0.15);
  background-color: rgba(251, 113, 133, 0.1);
  color: var(--danger-fg);
}

.btn-danger:hover:not(:disabled) {
  border-color: var(--danger-muted);
  background-color: rgba(251, 113, 133, 0.25);
  color: var(--fg-on-emphasis);
}

.btn-sm {
  padding: 0.375rem 0.75rem;
  font-size: 0.75rem;
  border-radius: 10px;
}

.w-full {
  width: 100%;
}

/* Badges */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  border-radius: 9999px;
  border: 1px solid transparent;
  padding: 0.125rem 0.5rem;
  font-size: 0.6875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.025em;
}

.badge-success {
  border-color: rgba(52, 211, 153, 0.15);
  background-color: rgba(52, 211, 153, 0.1);
  color: var(--success-fg);
}

.badge-attention {
  border-color: rgba(251, 191, 36, 0.15);
  background-color: rgba(251, 191, 36, 0.1);
  color: var(--attention-fg);
}

.badge-info {
  border-color: rgba(56, 189, 248, 0.15);
  background-color: rgba(56, 189, 248, 0.1);
  color: var(--accent-fg);
}

.badge-danger {
  border-color: rgba(251, 113, 133, 0.15);
  background-color: rgba(251, 113, 133, 0.1);
  color: var(--danger-fg);
}

.badge-neutral {
  border-color: var(--border-muted);
  background-color: var(--canvas-inset);
  color: var(--fg-muted);
}

/* Alerts */
.alert {
  border-radius: 12px;
  border: 1px solid transparent;
  padding: 0.75rem 1rem;
  font-size: 0.8125rem;
  line-height: 1.4;
  margin-bottom: 1.25rem;
  display: flex;
  align-items: flex-start;
  gap: 0.625rem;
}

.alert-error {
  border-color: rgba(251, 113, 133, 0.15);
  background-color: rgba(251, 113, 133, 0.08);
  color: var(--danger-fg);
}

.alert-info {
  border-color: rgba(56, 189, 248, 0.15);
  background-color: rgba(56, 189, 248, 0.08);
  color: var(--accent-fg);
}

.alert-icon {
  margin-top: 0.125rem;
  flex-shrink: 0;
  width: 1rem;
  height: 1rem;
}

/* Text Gradient & Styles */
.text-gradient {
  background-image: linear-gradient(120deg, #22d3ee, #38bdf8 45%, #a78bfa);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  display: inline-block;
}

.text-fade {
  color: var(--fg-muted);
}

.text-subtle {
  color: var(--fg-subtle);
  font-size: 0.75rem;
}

/* Grid Layout for Dashboard */
.dashboard-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
}

@media (min-width: 1024px) {
  .dashboard-grid {
    grid-template-columns: 5fr 7fr;
  }
}

/* Dashboard CDK Info Box */
.cdk-info-card {
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  margin-bottom: 1.5rem;
}

.cdk-info-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.cdk-label-title {
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--fg-muted);
}

.cdk-key-display {
  font-family: 'JetBrains Mono', 'Fira Code', monospace;
  font-size: 1rem;
  font-weight: 600;
}

.cdk-stats {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background-color: rgba(14, 20, 36, 0.4);
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  padding: 0.875rem 1.25rem;
}

.cdk-stat-item {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.cdk-stat-label {
  font-size: 0.75rem;
  color: var(--fg-subtle);
}

.cdk-stat-val {
  font-size: 1.125rem;
  font-weight: 700;
}

.cdk-actions {
  display: flex;
  gap: 0.75rem;
}

.cdk-actions .btn {
  flex: 1;
}

/* New Task Panel */
.panel-header {
  padding: 1.5rem;
  border-bottom: 1px solid var(--border-subtle);
}

.panel-title {
  font-size: 1rem;
  font-weight: 600;
}

.panel-body {
  padding: 1.5rem;
}

/* Service Type Selector Buttons */
.service-type-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}

.service-type-btn {
  border: 1px solid var(--border-default);
  background-color: var(--canvas-inset);
  border-radius: 12px;
  padding: 0.875rem;
  text-align: left;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.service-type-btn:hover {
  border-color: var(--accent-muted);
  background-color: var(--canvas-overlay);
}

.service-type-btn.active {
  border-color: var(--accent-fg);
  background-color: rgba(56, 189, 248, 0.08);
  box-shadow: 0 0 12px rgba(56, 189, 248, 0.12);
}

.service-type-title {
  font-size: 0.8125rem;
  font-weight: 600;
}

.service-type-cost {
  font-size: 0.75rem;
  color: var(--accent-fg);
  font-weight: 500;
}

.service-type-btn.active .service-type-cost {
  color: var(--accent-emphasis);
}

/* Tasks Logs & Records Panel */
.tasks-panel {
  display: flex;
  flex-direction: column;
  height: 100%;
}

.tasks-filter-bar {
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  gap: 0.75rem;
  align-items: center;
}

.search-wrapper {
  position: relative;
  flex: 1;
}

.search-input {
  padding-left: 2.25rem;
}

.search-icon {
  position: absolute;
  left: 0.875rem;
  top: 50%;
  transform: translateY(-50%);
  width: 0.875rem;
  height: 0.875rem;
  color: var(--fg-subtle);
  pointer-events: none;
}

.tasks-list-container {
  flex: 1;
  overflow-y: auto;
  max-height: 520px;
  min-height: 320px;
}

.table-modern {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.8125rem;
}

.table-modern th {
  padding: 0.75rem 1.25rem;
  font-weight: 500;
  color: var(--fg-muted);
  background-color: var(--canvas-inset);
  text-align: left;
  border-bottom: 1px solid var(--border-subtle);
  white-space: nowrap;
}

.table-modern td {
  padding: 0.875rem 1.25rem;
  border-bottom: 1px solid var(--border-subtle);
  vertical-align: middle;
}

.table-modern tr:hover {
  background-color: var(--canvas-overlay);
}

.task-cell-email {
  font-weight: 500;
  max-width: 180px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.task-cell-log {
  color: var(--fg-muted);
  line-height: 1.4;
}

.task-cell-actions {
  text-align: right;
  white-space: nowrap;
}

/* Empty task state */
.empty-tasks {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  padding: 4rem 2rem;
  color: var(--fg-muted);
  text-align: center;
}

.empty-tasks-icon {
  width: 3rem;
  height: 3rem;
  color: var(--fg-subtle);
  opacity: 0.5;
}

/* Modal overlays */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background-color: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

.modal-backdrop.active {
  opacity: 1;
  pointer-events: auto;
}

.modal {
  width: 100%;
  max-width: 520px;
  transform: translateY(16px);
  transition: transform 0.25s ease;
}

.modal-backdrop.active .modal {
  transform: translateY(0);
}

.modal-header {
  padding: 1.5rem;
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-title {
  font-size: 1rem;
  font-weight: 600;
}

.modal-close-btn {
  background: transparent;
  border: none;
  color: var(--fg-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 1.75rem;
  height: 1.75rem;
  border-radius: 9999px;
  transition: all 0.2s ease;
}

.modal-close-btn:hover {
  background-color: var(--canvas-overlay);
  color: var(--fg-default);
}

.modal-close-icon {
  width: 1rem;
  height: 1rem;
}

.modal-body {
  padding: 1.5rem;
}

.modal-footer {
  padding: 1.25rem 1.5rem;
  border-top: 1px solid var(--border-subtle);
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
}

/* Instructions Modal specifics */
.instruction-item {
  margin-bottom: 1rem;
}

.instruction-item:last-child {
  margin-bottom: 0;
}

.instruction-item-title {
  font-size: 0.875rem;
  font-weight: 600;
  margin-bottom: 0.25rem;
  display: flex;
  align-items: center;
  gap: 0.375rem;
}

.instruction-item-desc {
  font-size: 0.8125rem;
  color: var(--fg-muted);
  line-height: 1.4;
  padding-left: 1.25rem;
}

.modal-checkbox-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.8125rem;
  color: var(--fg-muted);
  user-select: none;
  cursor: pointer;
}

/* Spin loader */
.spinner {
  animation: spin 1s linear infinite;
  width: 1.125rem;
  height: 1.125rem;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* Fade in animations for views */
.view-fade-in {
  animation: viewFadeIn 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes viewFadeIn {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Progress logs timelines */
.timeline {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin: 0.75rem 0;
}

.timeline-step {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  font-size: 0.75rem;
}

.timeline-dot {
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 9999px;
  margin-top: 0.3125rem;
  flex-shrink: 0;
}

.timeline-dot.done {
  background-color: var(--success-fg);
  box-shadow: 0 0 6px var(--success-muted);
}

.timeline-dot.active {
  background-color: var(--accent-fg);
  box-shadow: 0 0 6px var(--accent-muted);
  animation: dotPulse 1.2s ease-in-out infinite alternate;
}

.timeline-dot.pending {
  background-color: var(--border-default);
}

.timeline-label {
  font-weight: 500;
}

.timeline-msg {
  color: var(--fg-muted);
}

@keyframes dotPulse {
  from {
    opacity: 0.4;
    transform: scale(0.9);
  }
  to {
    opacity: 1;
    transform: scale(1.1);
  }
}

/* API Document View specifically designed styles */
.api-doc-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
}

@media (min-width: 1024px) {
  .api-doc-grid {
    grid-template-columns: 280px 1fr;
  }
}

.api-sidebar {
  border-right: 1px solid var(--border-subtle);
  padding-right: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.api-sidebar-item {
  padding: 0.625rem 0.875rem;
  border-radius: 10px;
  font-size: 0.8125rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  color: var(--fg-muted);
}

.api-sidebar-item:hover {
  background-color: var(--canvas-inset);
  color: var(--fg-default);
}

.api-sidebar-item.active {
  background-color: rgba(56, 189, 248, 0.08);
  color: var(--accent-fg);
  font-weight: 600;
}

.api-content-card {
  padding: 2rem;
}

.api-title-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.api-method-badge {
  padding: 0.25rem 0.625rem;
  border-radius: 6px;
  font-family: 'JetBrains Mono', monospace;
  font-weight: 700;
  font-size: 0.75rem;
}

.api-method-badge.post {
  background-color: rgba(52, 211, 153, 0.1);
  color: var(--success-fg);
  border: 1px solid rgba(52, 211, 153, 0.15);
}

.api-method-badge.get {
  background-color: rgba(56, 189, 248, 0.1);
  color: var(--accent-fg);
  border: 1px solid rgba(56, 189, 248, 0.15);
}

.api-path-display {
  font-family: 'JetBrains Mono', monospace;
  font-weight: 600;
  font-size: 0.875rem;
  color: var(--fg-default);
  background-color: var(--canvas-inset);
  padding: 0.25rem 0.75rem;
  border-radius: 8px;
  border: 1px solid var(--border-subtle);
}

.api-rate-limit {
  font-size: 0.75rem;
  color: var(--attention-fg);
  margin-bottom: 1.5rem;
}

.api-code-block {
  font-family: 'JetBrains Mono', 'Fira Code', monospace;
  font-size: 0.75rem;
  background-color: var(--canvas-inset);
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  padding: 1.25rem;
  overflow-x: auto;
  margin: 1rem 0 1.5rem;
  color: #c9d1d9;
}

.api-doc-heading {
  font-size: 0.875rem;
  font-weight: 600;
  margin-top: 1.5rem;
  margin-bottom: 0.5rem;
}

.api-doc-heading:first-of-type {
  margin-top: 0;
}
