/* ==========================================================================
   PromptTracker - Modern Luminous Bright Theme
   Tailored for high readability, crisp contrast, and rich micro-interactions
   ========================================================================== */

:root {
  /* Color Palette - Crisp Light Surfaces */
  --bg-main: #f8fafc;
  --bg-surface: #ffffff;
  --bg-subtle: #f1f5f9;
  --bg-elevated: #ffffff;
  --bg-hover: #f1f5f9;

  /* Borders & Dividers */
  --border-subtle: #e2e8f0;
  --border-medium: #cbd5e1;
  --border-focus: #6366f1;

  /* Typography */
  --text-main: #0f172a;
  --text-muted: #64748b;
  --text-light: #94a3b8;
  --font-sans: 'Plus Jakarta Sans', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', Menlo, Consolas, monospace;

  /* Vibrant Accent Palette */
  --primary: #4f46e5;
  --primary-hover: #4338ca;
  --primary-light: #eef2ff;
  --primary-border: #c7d2fe;
  --primary-gradient: linear-gradient(135deg, #4f46e5 0%, #3b82f6 100%);

  --secondary: #0ea5e9;
  --secondary-light: #e0f2fe;

  /* Outcome Status Tokens */
  --status-success-text: #047857;
  --status-success-bg: #ecfdf5;
  --status-success-border: #a7f3d0;

  --status-revision-text: #b45309;
  --status-revision-bg: #fffbeb;
  --status-revision-border: #fde68a;

  --status-hallucinated-text: #6d28d9;
  --status-hallucinated-bg: #f5f3ff;
  --status-hallucinated-border: #ddd6fe;

  --status-failed-text: #b91c1c;
  --status-failed-bg: #fef2f2;
  --status-failed-border: #fecaca;

  /* Shadows */
  --shadow-xs: 0 1px 2px 0 rgba(0, 0, 0, 0.04);
  --shadow-sm: 0 1px 3px 0 rgba(0, 0, 0, 0.08), 0 1px 2px -1px rgba(0, 0, 0, 0.08);
  --shadow-md: 0 4px 16px -2px rgba(15, 23, 42, 0.07), 0 2px 6px -2px rgba(15, 23, 42, 0.05);
  --shadow-lg: 0 10px 30px -4px rgba(15, 23, 42, 0.09), 0 4px 10px -3px rgba(15, 23, 42, 0.05);
  --shadow-xl: 0 20px 40px -6px rgba(15, 23, 42, 0.12);

  /* Radii */
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-xl: 22px;
  --radius-full: 9999px;

  /* Transitions */
  --transition-fast: 0.15s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-normal: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Base Reset */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-sans);
  background-color: var(--bg-main);
  color: var(--text-main);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Scrollbars */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
::-webkit-scrollbar-track {
  background: var(--bg-subtle);
}
::-webkit-scrollbar-thumb {
  background: var(--border-medium);
  border-radius: var(--radius-full);
}
::-webkit-scrollbar-thumb:hover {
  background: var(--text-muted);
}

/* App Header */
.app-header {
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border-subtle);
  position: sticky;
  top: 0;
  z-index: 40;
  box-shadow: var(--shadow-xs);
}

.header-container {
  max-width: 1600px;
  margin: 0 auto;
  padding: 0.75rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
}

.brand-section {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  text-decoration: none;
  color: var(--text-main);
}

.brand-logo {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  background: var(--primary-gradient);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  box-shadow: 0 4px 12px rgba(79, 70, 229, 0.3);
}

.brand-info h1 {
  font-size: 1.25rem;
  font-weight: 800;
  letter-spacing: -0.025em;
  background: linear-gradient(135deg, #1e293b, #4f46e5);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.brand-info span {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: 500;
  display: block;
  margin-top: -2px;
}

.header-stats {
  display: flex;
  align-items: center;
  gap: 1rem;
  background: var(--bg-subtle);
  padding: 0.35rem 0.85rem;
  border-radius: var(--radius-full);
  border: 1px solid var(--border-subtle);
}

.stat-pill {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.stat-pill strong {
  color: var(--text-main);
  font-weight: 700;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

/* Main Layout Grid */
.app-layout {
  max-width: 1600px;
  margin: 0 auto;
  padding: 1.5rem;
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 1.5rem;
  flex: 1;
  width: 100%;
}

@media (max-width: 1024px) {
  .app-layout {
    grid-template-columns: 1fr;
  }
}

/* Sidebar: Project Navigation */
.sidebar-panel {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  height: calc(100vh - 110px);
  position: sticky;
  top: 85px;
}

.sidebar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
}

.sidebar-title {
  font-size: 0.95rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
}

.category-filter-pills {
  display: flex;
  gap: 0.4rem;
  overflow-x: auto;
  padding-bottom: 0.5rem;
  margin-bottom: 0.75rem;
}

.cat-pill {
  font-size: 0.75rem;
  padding: 0.25rem 0.65rem;
  border-radius: var(--radius-full);
  background: var(--bg-subtle);
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
  cursor: pointer;
  white-space: nowrap;
  font-weight: 600;
  transition: var(--transition-fast);
}

.cat-pill:hover {
  background: var(--border-subtle);
  color: var(--text-main);
}

.cat-pill.active {
  background: var(--primary);
  color: #ffffff;
  border-color: var(--primary);
}

.project-search-box {
  position: relative;
  margin-bottom: 0.85rem;
}

.project-search-box input {
  width: 100%;
  padding: 0.55rem 0.75rem 0.55rem 2.2rem;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  font-size: 0.85rem;
  background: var(--bg-subtle);
  color: var(--text-main);
  outline: none;
  transition: var(--transition-fast);
}

.project-search-box input:focus {
  background: #ffffff;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.12);
}

.project-search-box svg {
  position: absolute;
  left: 0.75rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-light);
  width: 16px;
  height: 16px;
}

.project-list {
  list-style: none;
  overflow-y: auto;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding-right: 0.25rem;
}

.project-item {
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 0.75rem 0.9rem;
  cursor: pointer;
  background: #ffffff;
  transition: var(--transition-fast);
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  position: relative;
}

.project-item:hover {
  border-color: var(--primary-border);
  background: var(--primary-light);
  transform: translateY(-1px);
}

.project-item.active {
  border-color: var(--primary);
  background: var(--primary-light);
  box-shadow: 0 2px 8px rgba(79, 70, 229, 0.12);
}

.project-item.active::before {
  content: '';
  position: absolute;
  left: 0;
  top: 10%;
  bottom: 10%;
  width: 4px;
  background: var(--primary);
  border-radius: 0 4px 4px 0;
}

.project-item-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.project-item-title {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text-main);
}

.project-color-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}

.project-prompt-badge {
  font-size: 0.7rem;
  font-weight: 700;
  padding: 0.15rem 0.45rem;
  border-radius: var(--radius-full);
  background: #ffffff;
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
}

.project-item-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* Main Content Area */
.main-content {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

/* Project Hero Card */
.project-hero-card {
  background: #ffffff;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 1rem;
  position: relative;
  overflow: hidden;
}

.hero-glow-accent {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: var(--primary-gradient);
}

.hero-main-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1.5rem;
  flex-wrap: wrap;
}

.hero-details h2 {
  font-size: 1.6rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.hero-description {
  color: var(--text-muted);
  font-size: 0.95rem;
  margin-top: 0.35rem;
  max-width: 900px;
}

.hero-tags-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-top: 0.65rem;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.25rem 0.65rem;
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 600;
  line-height: 1;
}

.badge-primary {
  background: var(--primary-light);
  color: var(--primary);
  border: 1px solid var(--primary-border);
}

.badge-category {
  background: #f1f5f9;
  color: #475569;
  border: 1px solid #cbd5e1;
}

.badge-status-active {
  background: var(--status-success-bg);
  color: var(--status-success-text);
  border: 1px solid var(--status-success-border);
}

.badge-status-completed {
  background: #f0fdf4;
  color: #166534;
  border: 1px solid #bbf7d0;
}

.badge-status-archived {
  background: #f8fafc;
  color: #64748b;
  border: 1px solid #e2e8f0;
}

.hero-actions {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

/* Quick Stats Bar in Hero */
.hero-stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 0.85rem;
  padding-top: 0.85rem;
  border-top: 1px solid var(--border-subtle);
}

.hero-stat-card {
  background: var(--bg-subtle);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 0.75rem 1rem;
}

.hero-stat-card span {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  color: var(--text-muted);
  display: block;
}

.hero-stat-card strong {
  font-size: 1.3rem;
  font-weight: 800;
  color: var(--text-main);
  display: block;
  margin-top: 0.15rem;
}

/* Quick Direct Prompt Input Card */
.quick-prompt-card {
  background: #ffffff;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 1.25rem 1.5rem;
  box-shadow: var(--shadow-sm);
  transition: var(--transition-fast);
}

.quick-prompt-card:focus-within {
  border-color: var(--primary-border);
  box-shadow: 0 4px 20px rgba(79, 70, 229, 0.08);
}

.quick-prompt-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.75rem;
}

.quick-prompt-title {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-main);
}

.quick-prompt-textarea {
  width: 100%;
  font-family: var(--font-mono);
  font-size: 0.92rem;
  line-height: 1.6;
  padding: 0.85rem 1rem;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  background: #f8fafc;
  resize: vertical;
  min-height: 110px;
  outline: none;
  transition: var(--transition-fast);
}

.quick-prompt-textarea:focus {
  background: #ffffff;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

.quick-prompt-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 0.85rem;
  flex-wrap: wrap;
}

/* WYSIWYG Editor Styles */
.wysiwyg-wrapper {
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  overflow: hidden;
  background: #ffffff;
  transition: var(--transition-fast);
}

.wysiwyg-wrapper:focus-within {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

.wysiwyg-toolbar {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.4rem 0.65rem;
  background: var(--bg-subtle);
  border-bottom: 1px solid var(--border-subtle);
  flex-wrap: wrap;
}

.wysiwyg-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.3rem 0.55rem;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-main);
  font-size: 0.8rem;
  font-family: var(--font-sans);
  cursor: pointer;
  transition: var(--transition-fast);
}

.wysiwyg-btn:hover {
  background: #ffffff;
  border-color: var(--border-medium);
  color: var(--primary);
}

.wysiwyg-btn:active {
  background: var(--primary-light);
  border-color: var(--primary);
}

.wysiwyg-divider {
  width: 1px;
  height: 18px;
  background: var(--border-medium);
  margin: 0 0.35rem;
}

.wysiwyg-editor {
  min-height: 140px;
  max-height: 480px;
  overflow-y: auto;
  padding: 0.85rem 1rem;
  font-family: var(--font-sans);
  font-size: 0.95rem;
  line-height: 1.7;
  color: var(--text-main);
  outline: none;
}

.wysiwyg-editor:empty:before {
  content: attr(data-placeholder);
  color: var(--text-light);
  pointer-events: none;
  display: block;
}

/* Formatted list styling inside editor and cards */
.wysiwyg-editor ul,
.prompt-rendered-body ul {
  list-style-type: disc;
  margin-left: 1.6rem;
  margin-top: 0.4rem;
  margin-bottom: 0.4rem;
}

.wysiwyg-editor ol,
.prompt-rendered-body ol {
  list-style-type: decimal;
  margin-left: 1.6rem;
  margin-top: 0.4rem;
  margin-bottom: 0.4rem;
}

.wysiwyg-editor li,
.prompt-rendered-body li {
  margin-bottom: 0.25rem;
}

.wysiwyg-editor pre,
.prompt-rendered-body pre {
  background: #f8fafc;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 0.65rem 0.85rem;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  margin: 0.5rem 0;
  overflow-x: auto;
}

.wysiwyg-editor code,
.prompt-rendered-body code {
  font-family: var(--font-mono);
  background: #f1f5f9;
  padding: 0.15rem 0.35rem;
  border-radius: 4px;
  font-size: 0.85em;
  color: #4338ca;
}

.prompt-rendered-body {
  font-size: 0.95rem;
  line-height: 1.7;
  color: #1e293b;
  word-break: break-word;
}

/* View Toolbar & Controls */
.toolbar-panel {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 0.85rem 1.25rem;
  box-shadow: var(--shadow-sm);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.view-mode-toggle {
  display: flex;
  background: var(--bg-subtle);
  padding: 0.25rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
}

.view-toggle-btn {
  padding: 0.35rem 0.75rem;
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-size: 0.82rem;
  font-weight: 600;
  border-radius: var(--radius-sm);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  transition: var(--transition-fast);
}

.view-toggle-btn:hover {
  color: var(--text-main);
}

.view-toggle-btn.active {
  background: #ffffff;
  color: var(--primary);
  box-shadow: var(--shadow-xs);
  font-weight: 700;
}

.filter-group {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  flex-wrap: wrap;
}

.filter-select {
  padding: 0.45rem 0.75rem;
  font-size: 0.82rem;
  font-weight: 500;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
  background: #ffffff;
  color: var(--text-main);
  outline: none;
  cursor: pointer;
  transition: var(--transition-fast);
}

.filter-select:focus {
  border-color: var(--primary);
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  padding: 0.55rem 1rem;
  border-radius: var(--radius-md);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition-fast);
  border: 1px solid transparent;
  line-height: 1.2;
}

.btn-primary {
  background: var(--primary-gradient);
  color: #ffffff;
  box-shadow: 0 4px 14px rgba(79, 70, 229, 0.25);
}

.btn-primary:hover {
  opacity: 0.95;
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(79, 70, 229, 0.35);
}

.btn-secondary {
  background: var(--bg-surface);
  border-color: var(--border-medium);
  color: var(--text-main);
}

.btn-secondary:hover {
  background: var(--bg-subtle);
  border-color: var(--text-muted);
}

.btn-outline-primary {
  background: #ffffff;
  border-color: var(--primary-border);
  color: var(--primary);
}

.btn-outline-primary:hover {
  background: var(--primary-light);
}

.btn-danger-outline {
  background: #ffffff;
  border-color: #fecaca;
  color: #dc2626;
}

.btn-danger-outline:hover {
  background: #fef2f2;
}

.btn-sm {
  padding: 0.35rem 0.65rem;
  font-size: 0.78rem;
  border-radius: var(--radius-sm);
}

.btn-icon {
  padding: 0.5rem;
  border-radius: var(--radius-md);
  line-height: 1;
}

/* ==========================================================================
   TIMELINE VIEW
   ========================================================================== */
.timeline-container {
  position: relative;
  padding: 1rem 0 2rem 2.5rem;
}

.timeline-container::before {
  content: '';
  position: absolute;
  left: 17px;
  top: 15px;
  bottom: 15px;
  width: 3px;
  background: linear-gradient(to bottom, #6366f1, #38bdf8, #cbd5e1);
  border-radius: var(--radius-full);
}

.timeline-node {
  position: relative;
  margin-bottom: 2rem;
  animation: fadeIn 0.3s ease;
}

.timeline-node:last-child {
  margin-bottom: 0;
}

.timeline-marker {
  position: absolute;
  left: -2.5rem;
  top: 1.25rem;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #ffffff;
  border: 3px solid var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.72rem;
  font-weight: 800;
  color: var(--primary);
  box-shadow: 0 0 0 4px #ffffff, var(--shadow-sm);
  z-index: 2;
}

/* Prompt Card */
.prompt-card {
  background: #ffffff;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  box-shadow: var(--shadow-sm);
  transition: var(--transition-normal);
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.prompt-card:hover {
  border-color: var(--border-medium);
  box-shadow: var(--shadow-md);
}

.prompt-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.prompt-card-title-group {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.prompt-card-title-group h3 {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.version-tag {
  background: #eff6ff;
  color: #2563eb;
  border: 1px solid #bfdbfe;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  padding: 0.15rem 0.5rem;
  border-radius: var(--radius-sm);
  font-weight: 700;
}

.prompt-meta-pills {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  font-size: 0.78rem;
  color: var(--text-muted);
}

.model-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.2rem 0.55rem;
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 700;
  background: #f8fafc;
  border: 1px solid #cbd5e1;
  color: #1e293b;
}

.model-gpt { background: #ecfdf5; border-color: #a7f3d0; color: #065f46; }
.model-claude { background: #fff7ed; border-color: #fed7aa; color: #9a3412; }
.model-gemini { background: #eff6ff; border-color: #bfdbfe; color: #1e40af; }
.model-deepseek { background: #faf5ff; border-color: #e9d5ff; color: #6b21a8; }

.outcome-badge {
  padding: 0.2rem 0.6rem;
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: capitalize;
}

.outcome-success {
  background: var(--status-success-bg);
  color: var(--status-success-text);
  border: 1px solid var(--status-success-border);
}

.outcome-needs_revision {
  background: var(--status-revision-bg);
  color: var(--status-revision-text);
  border: 1px solid var(--status-revision-border);
}

.outcome-hallucinated {
  background: var(--status-hallucinated-bg);
  color: var(--status-hallucinated-text);
  border: 1px solid var(--status-hallucinated-border);
}

.outcome-failed {
  background: var(--status-failed-bg);
  color: var(--status-failed-text);
  border: 1px solid var(--status-failed-border);
}

.stars-rating {
  display: inline-flex;
  align-items: center;
  gap: 0.15rem;
  color: #f59e0b;
}

/* Prompt Card Body / Content Blocks */
.prompt-content-box {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.section-label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.section-label {
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.code-container {
  position: relative;
  background: #f8fafc;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 1rem;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: #1e293b;
  white-space: pre-wrap;
  word-break: break-word;
  max-height: 280px;
  overflow-y: auto;
  line-height: 1.6;
}

.code-container.system-prompt-box {
  background: #fffbeb;
  border-color: #fef3c7;
  color: #92400e;
  font-size: 0.82rem;
}

.code-container.response-box {
  background: #ffffff;
  border-color: var(--border-subtle);
}

.copy-btn-corner {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  background: #ffffff;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 0.3rem 0.55rem;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.3rem;
  box-shadow: var(--shadow-xs);
  transition: var(--transition-fast);
}

.copy-btn-corner:hover {
  background: var(--bg-subtle);
  color: var(--text-main);
  border-color: var(--border-medium);
}

/* Prompt Card Notes Block */
.prompt-notes-block {
  background: #f0fdf4;
  border-left: 4px solid #10b981;
  padding: 0.75rem 1rem;
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  font-size: 0.85rem;
  color: #065f46;
}

.prompt-notes-block strong {
  display: block;
  font-weight: 700;
  margin-bottom: 0.2rem;
}

/* Prompt Card Footer Actions */
.prompt-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-top: 1px solid var(--border-subtle);
  padding-top: 0.85rem;
  gap: 1rem;
  flex-wrap: wrap;
}

.prompt-tags-list {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  flex-wrap: wrap;
}

.prompt-tag {
  background: var(--bg-subtle);
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
  font-size: 0.72rem;
  font-weight: 600;
  padding: 0.15rem 0.5rem;
  border-radius: var(--radius-full);
}

.prompt-actions-buttons {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* ==========================================================================
   GRID & TABLE VIEWS
   ========================================================================== */
.grid-view-container {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(380px, 1fr));
  gap: 1.25rem;
}

.table-view-container {
  background: #ffffff;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  overflow-x: auto;
  box-shadow: var(--shadow-sm);
}

.prompt-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
  text-align: left;
}

.prompt-table th {
  background: var(--bg-subtle);
  padding: 0.85rem 1rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  font-size: 0.75rem;
  letter-spacing: 0.04em;
  border-bottom: 1px solid var(--border-subtle);
}

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

.prompt-table tr:hover td {
  background: var(--primary-light);
}

/* ==========================================================================
   MODALS
   ========================================================================== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.4);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  opacity: 0;
  visibility: hidden;
  transition: var(--transition-normal);
  padding: 1rem;
}

.modal-overlay.active {
  opacity: 1;
  visibility: visible;
}

.modal-card {
  background: #ffffff;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-subtle);
  box-shadow: var(--shadow-xl);
  width: 100%;
  max-width: 760px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  transform: translateY(20px) scale(0.98);
  transition: var(--transition-normal);
  overflow: hidden;
}

.modal-overlay.active .modal-card {
  transform: translateY(0) scale(1);
}

.modal-card.modal-lg {
  max-width: 1100px;
}

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

.modal-header h3 {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.modal-close-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 0.4rem;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-close-btn:hover {
  background: var(--bg-subtle);
  color: var(--text-main);
}

.modal-body {
  padding: 1.5rem;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 1.2rem;
}

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

/* Forms & Inputs */
.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.form-label {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text-main);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.form-hint {
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--text-muted);
}

.form-control {
  width: 100%;
  padding: 0.65rem 0.85rem;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  font-size: 0.9rem;
  background: #ffffff;
  color: var(--text-main);
  font-family: inherit;
  outline: none;
  transition: var(--transition-fast);
}

.form-control:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.12);
}

textarea.form-control {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  resize: vertical;
  min-height: 120px;
}

.form-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.form-grid-3 {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 1rem;
}

@media (max-width: 640px) {
  .form-grid-2, .form-grid-3 {
    grid-template-columns: 1fr;
  }
}

/* Star Rating Selector in Form */
.rating-picker {
  display: flex;
  gap: 0.35rem;
  font-size: 1.4rem;
  cursor: pointer;
  color: #cbd5e1;
}

.rating-picker span.active {
  color: #f59e0b;
}

/* Live Token Estimator Pill */
.token-counter-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.75rem;
  font-weight: 700;
  background: #f1f5f9;
  border: 1px solid #cbd5e1;
  padding: 0.2rem 0.6rem;
  border-radius: var(--radius-full);
  color: var(--text-main);
}

/* ==========================================================================
   PROMPT DIFF VIEWER
   ========================================================================== */
.diff-selectors-row {
  display: flex;
  align-items: center;
  gap: 1rem;
  background: var(--bg-subtle);
  padding: 0.75rem 1rem;
  border-radius: var(--radius-md);
}

.diff-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.diff-col {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.diff-box {
  background: #f8fafc;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 1rem;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  max-height: 400px;
  overflow-y: auto;
  line-height: 1.6;
}

.diff-line-del {
  background-color: #fee2e2;
  color: #991b1b;
  display: block;
  padding: 0.1rem 0.3rem;
  border-radius: 2px;
}

.diff-line-add {
  background-color: #dcfce7;
  color: #166534;
  display: block;
  padding: 0.1rem 0.3rem;
  border-radius: 2px;
}

.diff-line-same {
  color: #475569;
  display: block;
  padding: 0.1rem 0.3rem;
}

/* ==========================================================================
   TEMPLATE LIBRARY MODAL
   ========================================================================== */
.templates-list-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1rem;
}

.template-card {
  background: #ffffff;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 1rem;
  cursor: pointer;
  transition: var(--transition-fast);
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.template-card:hover {
  border-color: var(--primary);
  background: var(--primary-light);
  transform: translateY(-2px);
  box-shadow: var(--shadow-sm);
}

.template-card h4 {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-main);
}

.template-card p {
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* Toast Notifications */
.toast-container {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  z-index: 200;
}

.toast {
  background: #ffffff;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 0.85rem 1.25rem;
  box-shadow: var(--shadow-lg);
  display: flex;
  align-items: center;
  gap: 0.65rem;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-main);
  animation: slideUp 0.25s ease;
  min-width: 260px;
}

.toast-success {
  border-left: 4px solid #10b981;
}

.toast-error {
  border-left: 4px solid #ef4444;
}

/* Animations */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

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

/* Empty State */
.empty-state {
  text-align: center;
  padding: 3rem 1rem;
  background: #ffffff;
  border: 2px dashed var(--border-medium);
  border-radius: var(--radius-lg);
}

.empty-state svg {
  color: var(--text-light);
  margin-bottom: 1rem;
}

.empty-state h3 {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 0.35rem;
}

.empty-state p {
  font-size: 0.9rem;
  color: var(--text-muted);
  max-width: 480px;
  margin: 0 auto 1.25rem auto;
}

/* =========================================================================
   Execution Checklist & Status Pills
   ========================================================================= */
.execution-checklist-group {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  flex-wrap: wrap;
}

.checklist-label {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.86rem;
  font-weight: 600;
  color: var(--text-main);
}

.status-radio-pills {
  display: inline-flex;
  background: #f1f5f9;
  padding: 3px;
  border-radius: var(--radius-full);
  border: 1px solid var(--border-medium);
  gap: 3px;
}

.status-pill-opt {
  cursor: pointer;
  margin: 0;
  position: relative;
  display: inline-flex;
}

.status-pill-opt input[type="radio"] {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.status-pill-opt .pill-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.35rem 0.85rem;
  border-radius: var(--radius-full);
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-muted);
  background: transparent;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  user-select: none;
}

.status-pill-opt input[type="radio"]:checked + .pill-btn.pill-sudah {
  background: #10b981;
  color: #ffffff;
  box-shadow: 0 2px 6px rgba(16, 185, 129, 0.35);
}

.status-pill-opt input[type="radio"]:checked + .pill-btn.pill-belum {
  background: #f59e0b;
  color: #ffffff;
  box-shadow: 0 2px 6px rgba(245, 158, 11, 0.35);
}

.status-pill-opt:hover .pill-btn {
  color: var(--text-main);
}

/* Card Timeline / Table Execution Badges */
.prompt-executed-badge-wrapper {
  display: inline-flex;
  align-items: center;
}

.status-badge-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.3rem 0.75rem;
  border-radius: var(--radius-full);
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all 0.2s ease;
  outline: none;
}

.badge-executed-sudah {
  background: #ecfdf5;
  color: #065f46;
  border-color: #a7f3d0;
}

.badge-executed-sudah:hover {
  background: #d1fae5;
  border-color: #34d399;
  transform: translateY(-1px);
  box-shadow: 0 2px 4px rgba(16, 185, 129, 0.15);
}

.badge-executed-belum {
  background: #fffbeb;
  color: #92400e;
  border-color: #fde68a;
}

.badge-executed-belum:hover {
  background: #fef3c7;
  border-color: #fbbf24;
  transform: translateY(-1px);
  box-shadow: 0 2px 4px rgba(245, 158, 11, 0.15);
}

.badge-toggle-hint {
  font-size: 0.72rem;
  opacity: 0.75;
  margin-left: 0.25rem;
  font-weight: 500;
}

.status-badge-toggle-sm {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.25rem 0.65rem;
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all 0.15s ease;
}

/* Filter Pills in Toolbar */
.status-filter-pills {
  display: inline-flex;
  background: #f1f5f9;
  padding: 3px;
  border-radius: var(--radius-full);
  border: 1px solid var(--border-subtle);
  gap: 2px;
}

.status-filter-btn {
  border: none;
  background: transparent;
  padding: 0.35rem 0.75rem;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-muted);
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: all 0.2s ease;
}

.status-filter-btn:hover {
  color: var(--text-main);
}

.status-filter-btn.active {
  background: #ffffff;
  color: var(--primary);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.status-filter-btn.active.btn-filter-sudah {
  background: #ecfdf5;
  color: #065f46;
  font-weight: 700;
}

.status-filter-btn.active.btn-filter-belum {
  background: #fffbeb;
  color: #92400e;
  font-weight: 700;
}
