/* ==========================================================================
   1. Core Reset & Global Layout
   ========================================================================== */
   * {
    box-sizing: border-box;
  }
  
  body {
    margin: 0;
    background: #020617;
    color: #e5e7eb;
    font-family: Arial, sans-serif;
  }

  html[data-theme="light"] body {
    background: #eef7fb;
    color: #26384a;
  }

  html[data-theme="light"] .datamodel-header h1,
  html[data-theme="light"] .dm-panel h2,
  html[data-theme="light"] .section-title,
  html[data-theme="light"] .task-slide-header h3 {
    color: #132033;
  }

  html[data-theme="light"] .datamodel-header p,
  html[data-theme="light"] .section-title p,
  html[data-theme="light"] .chat-header small,
  html[data-theme="light"] .dm-field label {
    color: #52677c;
  }

  html[data-theme="light"] .datamodel-main,
  html[data-theme="light"] .datamodel-chat,
  html[data-theme="light"] .task-slide,
  html[data-theme="light"] .chat-input-area,
  html[data-theme="light"] .dm-loading-card {
    background: #ffffff;
    border-color: #9fc4d5;
  }

  html[data-theme="light"] .datamodel-tabs,
  html[data-theme="light"] .chat-header {
    background: #e7f1f7;
    border-color: #bfd5df;
  }

  html[data-theme="light"] .dm-tab,
  html[data-theme="light"] .secondary-btn,
  html[data-theme="light"] .dm-field textarea,
  html[data-theme="light"] .chat-input-area textarea {
    background: #ffffff;
    color: #132033;
    border-color: #9fc4d5;
  }

  html[data-theme="light"] .chat-row.ai .chat-bubble {
    background: #e7f1f7;
    color: #132033;
  }
  
  .datamodel-page {
    min-height: 100vh;
    padding: 14px;
  }
  
  /* ==========================================================================
     2. Header & Action Row
     ========================================================================== */
  .datamodel-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
    margin-bottom: 12px;
  }
  
  .datamodel-header h1 {
    margin: 0;
    font-size: 22px;
    color: #f8fafc;
  }
  
  .datamodel-header p {
    margin: 6px 0 0;
    color: #94a3b8;
    font-size: 13px;
  }
  
  .datamodel-actions {
    display: flex;
    gap: 10px;
  }
  
  .primary-btn,
  .secondary-btn {
    border: 1px solid #334155;
    border-radius: 10px;
    padding: 10px 14px;
    cursor: pointer;
    color: #ffffff;
    transition: opacity 0.15s ease;
  }
  
  .primary-btn {
    background: #2563eb;
    border-color: #3b82f6;
  }
  
  .secondary-btn {
    background: #0f172a;
  }
  
  .primary-btn:hover,
  .secondary-btn:hover {
    opacity: 0.92;
  }
  
  /* ==========================================================================
     3. Main Application Workspace Layout
     ========================================================================== */
  .datamodel-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.2fr) minmax(0, 0.8fr); /* Balanced workspace ratio */
    gap: 14px;
    height: calc(100vh - 82px);
    overflow: hidden;
  }
  
  .datamodel-main,
  .datamodel-chat {
    min-width: 0;
    min-height: 0;
    background: linear-gradient(180deg, #020817, #020617);
    border: 1px solid #1e3a5f;
    border-radius: 14px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
  }
  
  /* Tab Bar Navigation */
  .datamodel-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 12px;
    border-bottom: 1px solid #1e293b;
    background: #020617;
  }
  
  .dm-tab {
    padding: 9px 14px;
    border: 1px solid #334155;
    border-radius: 999px;
    background: #0f172a;
    color: #cbd5e1;
    cursor: pointer;
    transition: all 0.15s ease;
  }
  
  .dm-tab:hover {
    border-color: #3b82f6;
    color: #ffffff;
  }
  
  .dm-tab.active {
    background: #2563eb;
    border-color: #3b82f6;
    color: #ffffff;
  }
  
  /* View Content Panels */
  .datamodel-content {
    flex: 1;
    padding: 14px;
    overflow-y: auto;
    min-height: 0;
  }
  
  .dm-panel {
    display: none;
  }
  
  .dm-panel.active {
    display: flex;
    flex-direction: column;
    height: 100%;
    min-height: 0;
  }
  
  .section-title {
    margin-bottom: 16px;
  }
  
  .section-title h2,
  .dm-panel h2 {
    margin: 0;
    color: #f8fafc;
    font-size: 18px;
  }
  
  .section-title p {
    margin: 6px 0 0;
    color: #94a3b8;
    font-size: 13px;
  }
  
  /* Dynamic Content Forms */
  .dm-form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
  }
  
  .dm-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
  }
  
  .dm-field.full-width {
    grid-column: 1 / -1;
  }
  
  .dm-field label {
    font-size: 13px;
    color: #93c5fd;
  }
  
  .dm-field input,
  .dm-field select,
  .dm-field textarea {
    width: 100%;
    background: #0f172a; /* <-- CHANGE THIS FROM #020617 */
    border: 1px solid #334155;
    border-radius: 10px;
    color: #e5e7eb;
    padding: 10px;
    outline: none;
  }
  
  .dm-field textarea {
    resize: vertical;
    min-height: 90px;
  }
  
  .dm-field input:focus,
  .dm-field select:focus,
  .dm-field textarea:focus {
    border-color: #3b82f6;
  }
  
  /* ==========================================================================
     4. Task Slider Component (Interactive UI Carousel)
     ========================================================================== */
  .task-slider {
    position: relative;
    flex: 1;
    min-height: 0;
    height: calc(100vh - 230px);
    margin-top: 16px;
    overflow: hidden;
  }
  
  .task-track {
    display: flex;
    flex-direction: row;
    gap: 18px;
    height: 100%;
    min-width: 0;
    overflow-x: auto; /* Fallback support for structural scrolling if JS pauses */
    scrollbar-width: none; /* Keeps layout completely clean across browsers */
    padding: 12px 56px;
    scroll-behavior: smooth;
    align-items: stretch;
  }
  
  .task-track::-webkit-scrollbar {
    display: none;
  }
  
  .task-slide {
    flex: 0 0 82%;
    height: 100%;
    min-height: 0;
    overflow-y: auto;
    padding: 26px;
    border-radius: 22px;
    border: 1px solid #1e3a5f;
    background: linear-gradient(180deg, #020817, #020617);
    color: #cbd5e1;
    opacity: 0.34;
    transform: scale(0.96);
    transition: transform 0.22s ease, opacity 0.22s ease, border-color 0.22s ease, box-shadow 0.22s ease;
  }
  
  .task-slide.active {
    opacity: 1;
    transform: scale(1);
    border-color: #3b82f6;
    box-shadow: 0 18px 42px rgba(0, 0, 0, 0.4), 0 0 0 1px rgba(59, 130, 246, 0.22);
  }
  
  .task-slide.previous,
  .task-slide.next {
    opacity: 0.52;
  }
  
  /* Unified Slider Floating Nav Controls */
  .task-slider .slider-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 5;
    width: 42px;
    height: 120px;
    border: 1px solid rgba(59, 130, 246, 0.45);
    border-radius: 999px;
    background: rgba(15, 23, 42, 0.94);
    color: #dbeafe;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.35);
    transition: all 0.18s ease;
  }
  
  .task-slider .prev-task { left: 14px; }
  .task-slider .next-task { right: 14px; }
  
  .task-slider .slider-nav:hover:not(:disabled) {
    background: rgba(30, 41, 59, 0.98);
    border-color: #3b82f6;
    transform: translateY(-50%) scale(1.05);
  }
  
  .task-slider .slider-nav:active:not(:disabled) {
    transform: translateY(-50%) scale(0.95);
  }
  
  .task-slider .slider-nav:disabled {
    opacity: 0.25;
    cursor: not-allowed;
  }
  
  .task-slider .slider-nav svg {
    width: 20px;
    height: 20px;
    stroke-width: 2.4;
  }
  
  /* Card Header Controls */
  .task-slide-header {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 14px;
    margin-bottom: 18px;
  }
  
  .task-slide-header h3 {
    margin: 0;
    font-size: 22px;
    line-height: 1.1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  
  .task-status {
    font-size: 13px;
    color: #93c5fd;
    white-space: nowrap;
  }
  
  .task-done-toggle {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 14px;
    border-radius: 999px;
    border: 1px solid #334155;
    background: rgba(15, 23, 42, 0.92);
    white-space: nowrap;
    cursor: pointer;
    transition: border-color 0.15s ease;
  }
  
  .task-done-toggle:hover {
    border-color: #3b82f6;
  }
  
  .task-done-toggle input {
    width: 15px;
    height: 15px;
    cursor: pointer;
  }
  
  .task-done-toggle span {
    font-size: 14px;
    font-weight: 600;
  }
  
  /* ==========================================================================
     5. AI Sidebar Interface (Persistent Chat)
     ========================================================================== */
  .chat-header {
    padding: 12px;
    border-bottom: 1px solid #1e293b;
    font-weight: 700;
    color: #f8fafc;
  }
  
  .chat-header small {
    display: block;
    margin-top: 2px;
    color: #94a3b8;
    font-weight: 400;
  }
  
  .chat-messages {
    flex: 1;
    min-height: 0;
    padding: 12px;
    overflow-y: auto;
    color: #cbd5e1;
  }
  
  .chat-row {
    display: flex;
    margin-bottom: 12px;
  }
  
  .chat-row.user { justify-content: flex-end; }
  .chat-row.ai { justify-content: flex-start; }
  
  .chat-bubble {
    max-width: 86%;
    padding: 11px 14px;
    border-radius: 14px;
    background: #0f172a;
    border: 1px solid #1e3a5f;
    color: #e2e8f0;
    font-size: 13px;
    line-height: 1.55;
  }
  
  .chat-row.user .chat-bubble {
    background: #2563eb;
    border-color: #3b82f6;
  }
  
  .chat-input-area {
    border-top: 1px solid #1e293b;
    padding: 10px;
    display: flex;
    gap: 10px;
  }
  
  .chat-input-area textarea {
    flex: 1;
    min-height: 50px;
    max-height: 140px;
    resize: none; /* Changed to avoid destroying app frame integrity */
    border-radius: 10px;
    border: 1px solid #334155;
    background: #020617;
    color: #e5e7eb;
    padding: 10px;
    outline: none;
  }
  
  .chat-input-area textarea:focus {
    border-color: #3b82f6;
  }
  
  .chat-input-area button {
    width: 84px;
    border: none;
    border-radius: 10px;
    background: #2563eb;
    color: #ffffff;
    cursor: pointer;
    transition: opacity 0.15s ease;
  }
  
  .chat-input-area button:hover {
    opacity: 0.92;
  }
  
  /* Custom App Scrollbars */
  .datamodel-content::-webkit-scrollbar,
  .chat-messages::-webkit-scrollbar {
    width: 6px;
  }
  
  .datamodel-content::-webkit-scrollbar-thumb,
  .chat-messages::-webkit-scrollbar-thumb {
    background: #334155;
    border-radius: 999px;
  }
  
  /* ==========================================================================
     6. Responsive Viewports & Adaptations
     ========================================================================== */
  @media (max-width: 1100px) {
    .task-slide {
      flex-basis: 88%;
    }
  }
  
  @media (max-width: 900px) {
    .datamodel-layout {
      grid-template-columns: 1fr;
      height: auto;
      overflow: visible;
    }
  
    .datamodel-header {
      flex-direction: column;
      align-items: stretch;
    }
  
    .datamodel-actions {
      width: 100%;
    }
  
    .primary-btn,
    .secondary-btn {
      flex: 1;
      text-align: center;
    }
  
    .dm-form-grid {
      grid-template-columns: 1fr;
    }
  
    .task-slider {
      height: auto;
      overflow: visible;
    }
  
    .task-track {
      padding: 12px 14px;
      overflow-x: auto; /* Fallback natively to touch swipe gestures on small screens */
    }
  
    .task-slide {
      flex-basis: 100%;
    }
  
    /* Reposition slider arrows on touch/mobile viewports to stack comfortably below cards */
    .task-slider .slider-nav {
      position: static;
      transform: none;
      width: 48%;
      height: 44px;
      border-radius: 10px;
      display: inline-flex;
      margin-top: 10px;
    }
    
    .task-slider .prev-task { float: left; }
    .task-slider .next-task { float: right; }
  
    .datamodel-chat {
      min-height: 450px;
      margin-top: 14px;
    }
  }
  .chat-bubble pre {
    background: #071427;
    border: 1px solid #1e3a5f;
    border-radius: 10px;
    padding: 12px;
    overflow-x: auto;
    margin-top: 10px;
    margin-bottom: 10px;
  }
  
  .chat-bubble code {
    font-family: "Courier New", monospace;
    font-size: 12px;
    color: #cfe3ff;
  }
  
  .chat-bubble p {
    margin: 6px 0;
  }
  
  .chat-bubble ul,
  .chat-bubble ol {
    margin: 6px 0 6px 18px;
    padding: 0;
  }
  
  .chat-bubble li {
    margin-bottom: 4px;
  }
  
  .chat-bubble h1,
  .chat-bubble h2,
  .chat-bubble h3,
  .chat-bubble h4 {
    margin-top: 8px;
    margin-bottom: 6px;
  }
  .copy-code-btn {
    position: absolute;
    top: 8px;
    right: 8px;
    background: #2563eb;
    color: white;
    border: none;
    border-radius: 6px;
    padding: 4px 10px;
    font-size: 11px;
    cursor: pointer;
    transition: 0.2s ease;
  }
  
  .copy-code-btn:hover {
    background: #1d4ed8;
  }

  .task-detail-block {
    margin-top: 10px;
    padding-top: 8px;
    border-top: 1px solid rgba(255,255,255,0.08);
  }
  
  .task-detail-title {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #8fb8ff;
    margin-bottom: 4px;
  }
  
  .task-detail-list {
    margin: 0;
    padding-left: 18px;
  }
  
  .task-detail-list li {
    margin-bottom: 3px;
    font-size: 12px;
    line-height: 1.4;
    color: #dbe7ff;
  }
  /* ---------- MODERN EXECUTION SLIDES ---------- */

.task-slider {
  background: #020617;
  border: 1px solid #1e3a8a;
  border-radius: 18px;
  padding: 18px 28px;
  box-shadow: inset 0 0 0 1px rgba(59, 130, 246, 0.08);
}

.task-track {
  gap: 28px;
  scroll-behavior: smooth;
  scrollbar-width: thin;
  scrollbar-color: #3b82f6 #020617;
}

.task-slide {
  background: linear-gradient(180deg, #f8fafc 0%, #eaf1ff 100%);
  color: #0f172a;
  border: 1px solid #93c5fd;
  border-radius: 22px;
  box-shadow:
    0 18px 45px rgba(0, 0, 0, 0.35),
    0 0 0 1px rgba(255, 255, 255, 0.55) inset;
  padding: 26px 30px;
}

.task-slide h3,
.task-slide p,
.task-detail-list li {
  color: #0f172a;
}

.task-status,
.task-detail-title {
  color: #2563eb;
}

.task-detail-block {
  border-top: 1px solid rgba(37, 99, 235, 0.18);
}

.task-done-toggle {
  background: #e0ecff;
  border: 1px solid #bfdbfe;
  color: #1e3a8a;
}

.task-details-btn {
  margin-left: auto;
  background: linear-gradient(135deg, #2563eb, #1d4ed8);
  color: #ffffff;
  border: none;
  border-radius: 999px;
  padding: 8px 18px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 8px 22px rgba(37, 99, 235, 0.35);
}

.task-details-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 12px 28px rgba(37, 99, 235, 0.45);
}

.task-track::-webkit-scrollbar,
.datamodel-chat-messages::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

.task-track::-webkit-scrollbar-track,
.datamodel-chat-messages::-webkit-scrollbar-track {
  background: #020617;
  border-radius: 999px;
}

.task-track::-webkit-scrollbar-thumb,
.datamodel-chat-messages::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, #3b82f6, #1d4ed8);
  border-radius: 999px;
}

.task-track::-webkit-scrollbar-thumb:hover,
.datamodel-chat-messages::-webkit-scrollbar-thumb:hover {
  background: #60a5fa;
}
/* ==========================================
   MODERN TASK CONTENT RENDERING
========================================== */

.task-slide {
  font-size: 15px;
  line-height: 1.75;
}

.task-slide h3 {
  font-size: 30px;
  line-height: 1.2;
  font-weight: 800;
  margin-bottom: 20px;
  color: #0f172a;
}

.task-slide p {
  font-size: 15px;
  line-height: 1.8;
  color: #1e293b;
}

/* markdown blocks */

.task-slide strong {
  color: #1d4ed8;
  font-weight: 700;
}

.task-slide ul,
.task-slide ol {
  margin-top: 12px;
  margin-bottom: 18px;
  padding-left: 24px;
}

.task-slide li {
  margin-bottom: 10px;
  padding-left: 4px;
  line-height: 1.8;
  color: #0f172a;
}

.task-slide li::marker {
  color: #2563eb;
  font-weight: 700;
}

/* section titles */

.task-detail-title {
  margin-top: 26px;
  margin-bottom: 12px;
  font-size: 13px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-weight: 800;
  color: #2563eb;
}

/* inline code */

.task-slide code {
  display: inline-flex;
  align-items: center;

  background: #e5e7eb;
  color: #1f2937;

  border: 1px solid #d1d5db;

  border-radius: 8px;

  padding: 2px 8px;

  font-size: 12px;
  font-weight: 700;
  font-family: Consolas, Monaco, monospace;

  letter-spacing: 0.02em;

  box-shadow: none;
}

/* code blocks */

.task-slide pre {
  background: #0f172a;
  color: #e2e8f0;
  border-radius: 14px;
  padding: 18px;
  overflow-x: auto;
  margin-top: 14px;
  margin-bottom: 18px;
}

.task-slide pre code {
  background: transparent;
  padding: 0;
  color: inherit;
}

/* separators */

.task-detail-block {
  border-top: 1px solid rgba(37, 99, 235, 0.12);
  padding-top: 18px;
  margin-top: 18px;
}
/* ==========================================
   COMPACT EXECUTION HEADER
========================================== */

/* remove useless top heading block */

.execution-phase-header,
.step-phase-header,
.task-phase-header {
  display: none !important;
}

/* tighter slide top */

.task-slide {
  padding-top: 18px !important;
}

/* compact header */

.task-slide-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;

  margin-bottom: 10px !important;
  padding-bottom: 10px !important;
}

/* remove huge top spacing */

.task-slide-header h3 {
  margin: 0 !important;
  padding: 0 !important;

  font-size: 22px !important;
  line-height: 1.2 !important;

  max-width: 70%;
}

/* smaller task status */

.task-status {
  font-size: 11px !important;
  margin-bottom: 2px !important;
  opacity: 0.75;
}

/* compact done section */

.task-done-toggle {
  padding: 6px 12px !important;
  min-height: auto !important;
}

/* modern compact details button */

.task-details-btn {
  height: 36px;
  padding: 0 18px !important;

  border-radius: 999px;

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

  font-size: 12px !important;
  font-weight: 700;

  white-space: nowrap;
}

/* reduce intro paragraph spacing */

.task-slide > p {
  margin-top: 10px !important;
  margin-bottom: 14px !important;

  line-height: 1.6;
}

/* reduce separator spacing */

.task-detail-block {
  margin-top: 14px !important;
  padding-top: 14px !important;
}

/* execution header tighter */

.task-detail-title {
  margin-top: 0 !important;
  margin-bottom: 8px !important;
}

/* ==========================================
   SAP TECH PILLS
========================================== */
.task-slide code {
  display: inline-flex;
  align-items: center;

  background: #e5e7eb;
  color: #1f2937;

  border: 1px solid #d1d5db;

  border-radius: 8px;

  padding: 2px 8px;

  font-size: 12px;
  font-weight: 700;
  font-family: Consolas, Monaco, monospace;

  letter-spacing: 0.02em;

  box-shadow: none;
}
.dm-loading-overlay {
  position: fixed;
  inset: 0;
  background: rgba(2, 6, 23, 0.72);
  backdrop-filter: blur(6px);
  z-index: 9999;

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

.dm-loading-overlay.hidden {
  display: none;
}

.dm-loading-card {
  width: 360px;
  padding: 28px;
  border-radius: 22px;
  background: #f8fafc;
  color: #0f172a;
  text-align: center;
  box-shadow: 0 24px 60px rgba(0,0,0,0.45);
}

.dm-loading-card h3 {
  margin: 14px 0 6px;
  font-size: 20px;
}

.dm-loading-card p {
  margin: 0;
  color: #475569;
  font-size: 13px;
}

.dm-spinner {
  width: 42px;
  height: 42px;
  margin: 0 auto;
  border: 4px solid #dbeafe;
  border-top-color: #2563eb;
  border-radius: 50%;
  animation: dm-spin 0.9s linear infinite;
}

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