@import url("https://fonts.googleapis.com/css2?family=Montserrat:wght@400;700;900&family=Poppins:wght@300;400;500;600;700&display=swap");
@import url("https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&family=JetBrains+Mono:wght@400;500&display=swap");

:root {
  /* Premium Color Palette */
  --color-start: #334155; /* Deep Slate Blue */
  --color-validated: #059669; /* Rich Emerald */
  --color-active: #d97706; /* Warm Amber */
  --color-locked: #94a3b8; /* Soft Slate Gray */
  --color-end: #065f46; /* Royal Green */
  --color-archived: #dc2626; /* Refined Red */

  /* Legacy Support */
  --portal-orange: #d97706;
  --portal-green: #059669;
  --portal-red: #dc2626;

  /* Design Tokens */
  --charcoal: #111111;
  --wf-gray-light: #f5f5f5;
  --wf-gray-dark: #e0e0e0;
  --ease-out-expo: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-premium: cubic-bezier(0.33, 1, 0.68, 1);
  --smoke: #f4f4f5;
  --border: rgba(0, 0, 0, 0.06);

  /* Refined Shadows */
  --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.04);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.08);
  --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.12);
  --shadow-xl: 0 16px 48px rgba(0, 0, 0, 0.16);
}

/* Responsive Visibility Utilities */
.desktop-only {
  display: block !important;
}
.desktop-only-flex {
  display: flex !important;
}
.mobile-only {
  display: none !important;
}

@media (max-width: 900px) {
  .desktop-only,
  .desktop-only-flex {
    display: none !important;
  }
  .mobile-only {
    display: block !important;
  }
}

/* Decomposed Blocks Spacing */
.description-block {
  margin-top: 1rem;
  margin-bottom: 0.25rem;
}

.brand-title {
  margin-bottom: 0.5rem;
}

.sheet-left-top {
  display: flex;
  flex-direction: column;
}

.sheet-left-bottom {
  display: flex;
  flex-direction: column;
}

body.portal-page {
  font-family: "Poppins", sans-serif;
  background-color: #000;
  background-image: url("https://www.uteek.net/sites/default/files/images/uteek-digital.png");
  background-size: cover;
  background-position: center;
  background-attachment: fixed;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  margin: 0;
  padding: 20px;
}

/* Helper Animation */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* The "Card" - Premium Physics */
.sheet-container {
  position: relative;
  max-width: 900px;
  width: 100%;
  background: #000;
  padding: 0;
  box-shadow:
    0 40px 80px -20px rgba(0, 0, 0, 0.5),
    0 0 0 1px rgba(255, 255, 255, 0.1);
  opacity: 0;
  animation: fadeInUp 0.4s var(--ease-out-expo) forwards;
  animation-delay: 0s;
  overflow: hidden;
  display: flex;
  max-height: 82vh;
  border-radius: 4px;
  display: flex;
}

/* Decorative Corners (+ */
.sheet-corner {
  display: none;
}
.tl {
  top: 0;
  left: 0;
  border-right: none;
  border-bottom: none;
}
.tr {
  top: 0;
  right: 0;
  border-left: none;
  border-bottom: none;
}
.bl {
  bottom: 0;
  left: 0;
  border-right: none;
  border-top: none;
}
.br {
  bottom: 0;
  right: 0;
  border-left: none;
  border-top: none;
}

/* Layout Columns */
.sheet-left {
  width: 45%;
  padding: 30px;
  background: #000;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  border-right: 1px solid rgba(255, 255, 255, 0.1);
  position: relative;
  overflow-y: auto;
  scrollbar-width: none; /* Hide Firefox scrollbar */
  -ms-overflow-style: none; /* Hide IE/Edge scrollbar */
}

/* Hide WebKit scrollbar for sheet-left */
.sheet-left::-webkit-scrollbar {
  display: none;
}

.sheet-right {
  width: 55%;
  padding: 30px;
  background: #ffffff;
  position: relative;
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 0;
}

#portal-history-list {
  flex: 0 1 auto; /* Don't stretch to fill space, size by content */
  min-height: 0;
  display: flex;
  flex-direction: column;
  padding: 0;
  margin: 0;
  list-style: none;
}

@media (max-width: 900px) {
  body.portal-page {
    background-image: none !important;
    padding: 0 !important;
    overflow-x: hidden !important;
  }

  .sheet-container {
    flex-direction: column;
    max-width: 100%;
    width: 100%;
    margin: 0;
    border-radius: 0;
    height: auto !important;
    min-height: 100vh;
    max-height: none !important;
    overflow-y: visible !important;
    background: #000000 !important; /* Changed to black as per user request */
    padding-bottom: 0;
    box-shadow: none !important;
    border: none !important;
    display: flex;
    animation: none !important;
    transform: none !important;
    filter: none !important;
    perspective: none !important;
    contain: none !important;
    contain: none !important;
    will-change: auto !important;
    opacity: 1 !important; /* FIX: Animation is disabled, so we must manually show it */
  }

  /* Fixed Header Logic - Now using position: fixed for absolute persistence */
  .sheet-header-row-mobile, /* I'll add a class or target specifically */
  .sheet-left-top > .flex.items-center.justify-between:first-child {
    position: fixed !important;
    top: 0;
    left: 0;
    width: 100%;
    background: #000;
    z-index: 10000;
    padding: 15px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    box-sizing: border-box;
    display: flex;
    justify-content: space-between;
    align-items: center;
  }

  .sheet-left,
  .sheet-right {
    width: 100%;
    padding: 20px;
    height: auto !important;
    max-height: none !important;
    border: none;
    overflow: visible !important;
  }

  .sheet-left {
    padding-top: 80px !important; /* Space for fixed header */
    padding-bottom: 20vh !important; /* Ensure content isn't hidden behind the 20vh bottom sheet */
    background: #000; /* Keep top section black */
    transform: none !important;
    filter: none !important;
    perspective: none !important;
    contain: none !important;
    will-change: auto !important;
  }

  .sheet-right {
    position: fixed !important;
    bottom: 0 !important;
    left: 0 !important;
    right: 0 !important;
    width: 100% !important;
    height: 82vh !important;
    max-height: 82vh !important;
    background: transparent !important;
    border-radius: 20px 20px 0 0 !important;
    z-index: 9999 !important;
    transform: translateY(calc(100% - var(--mobile-sheet-visible, 85px)));
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    padding: 0 20px 20px 20px !important;
    display: flex !important;
    flex-direction: column !important;
    will-change: transform;
    overflow: visible !important;

    /* Mask Configuration: Perfect curved notch */
    --r: 20px;
    --s: 30px;
    --a: 20deg;
    --p: calc(100% - 55px); /* Moved 10px to the right (from 65px to 55px) */
    --cosA: 0.939;
    --sinA: 0.342;
    --_d: calc((var(--s) + var(--r)) * var(--cosA));
    --_y: calc(var(--r) * (1 - var(--sinA)));

    filter: drop-shadow(0 -5px 15px rgba(0, 0, 0, 0.15)) !important;
  }

  /* The masked background sits as a peer to the content to avoid clipping children */
  .sheet-right::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #ffffff;
    border-radius: 20px 20px 0 0;
    z-index: -1;
    pointer-events: none;

    -webkit-mask:
      radial-gradient(
        var(--r) at calc(var(--p) + var(--_d)) var(--r),
        #000 99%,
        #0000 101%
      ),
      radial-gradient(
        var(--r) at calc(var(--p) - var(--_d)) var(--r),
        #000 99%,
        #0000 101%
      ),
      radial-gradient(
          var(--s) at var(--p) calc(-1 * var(--sinA) * var(--s)),
          #0000 100%,
          #000 101%
        )
        0 var(--_y) no-repeat,
      linear-gradient(
        90deg,
        #000 calc(var(--p) - var(--_d)),
        #0000 0 calc(var(--p) + var(--_d)),
        #000 0
      );

    mask:
      radial-gradient(
        var(--r) at calc(var(--p) + var(--_d)) var(--r),
        #000 99%,
        #0000 101%
      ),
      radial-gradient(
        var(--r) at calc(var(--p) - var(--_d)) var(--r),
        #000 99%,
        #0000 101%
      ),
      radial-gradient(
          var(--s) at var(--p) calc(-1 * var(--sinA) * var(--s)),
          #0000 100%,
          #000 101%
        )
        0 var(--_y) no-repeat,
      linear-gradient(
        90deg,
        #000 calc(var(--p) - var(--_d)),
        #0000 0 calc(var(--p) + var(--_d)),
        #000 0
      );
  }

  .sheet-right.empty-history {
    display: none !important;
  }
  @media (max-width: 900px) {
    .sheet-right.empty-history {
      display: flex !important; /* Ensure visibility on mobile for the notch/handle */
    }
  }

  /* When active/expanded class is added by JS */
  .sheet-right.expanded {
    transform: translateY(0) !important;
  }

  /* Drag Handle Styling */
  .sheet-handle-bar {
    width: 100%;
    padding: 15px 0;
    display: flex;
    justify-content: center;
    cursor: grab;
    touch-action: none; /* Prevent browser scrolling while dragging handle */
  }

  .sheet-handle {
    width: 40px;
    height: 5px;
    background: #e2e8f0;
    border-radius: 10px;
  }

  .sheet-notch {
    position: absolute;
    right: 33px; /* Aligned with mask center --p: calc(100% - 55px) -> 55 - 22 = 33 */
    top: -24px;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10001;
    cursor: pointer;
    background: transparent;
  }

  .sheet-notch-btn {
    width: 44px;
    height: 44px;
    background: #ffffff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.12);
    border: 1px solid rgba(0, 0, 0, 0.05);
    transition: transform 0.4s var(--ease-premium);
  }

  .sheet-notch i,
  .sheet-notch svg {
    transition: transform 0.4s var(--ease-premium);
    display: block;
  }

  /* When the sheet is expanded, flip the arrow to point down */
  .sheet-right.expanded .sheet-notch i,
  .sheet-right.expanded .sheet-notch svg {
    transform: rotate(180deg) !important;
  }

  /* Hide the old static header/padding logic that might conflict */
  .sheet-right > .sheet-column-title {
    margin-top: 0 !important;
    padding-top: 0 !important;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05) !important;
    padding-bottom: 15px !important;
    margin-bottom: 15px !important;
  }

  /* Disable Internal Scroll Zones on Mobile -> EXCEPT for the Bottom Sheet Content */
  .sheet-left .projects-sidebar-list {
    overflow: visible !important;
    height: auto !important;
    max-height: none !important;
  }

  /* Make the right sheet content scrollable within the fixed bottom sheet */
  .sheet-right .vertical-stepper,
  .sheet-right .history-view-scroll,
  .sheet-right .activity-timeline {
    overflow-y: auto !important;
    height: auto !important; /* Let flex handle height */
    flex: 1 1 auto !important; /* Grow to fill space */
    max-height: none !important;
    overscroll-behavior: contain; /* Prevent chaining scroll to parent */
    padding-bottom: 20px;
  }

  /* Improved Project Cards Refined */
  .sidebar-project-card {
    padding: 16px 20px !important;
    background: rgba(255, 255, 255, 0.05) !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    border-radius: 18px !important;
    margin-bottom: 10px;
  }

  .sidebar-project-card .title {
    font-size: 15px !important;
    letter-spacing: -0.2px !important;
    margin-bottom: 4px !important;
  }

  .sidebar-project-card .meta {
    font-size: 10px !important;
    opacity: 0.6;
  }

  .card-thumb-small {
    width: 48px !important;
    height: 48px !important;
    border-radius: 12px !important;
  }

  .card-info-compact {
    margin-left: 15px !important;
  }

  /* Adjust Circular Progress on Mobile */
  .card-circular-progress {
    top: 18px !important;
    right: 20px !important;
    width: 24px !important;
    height: 24px !important;
  }

  .sheet-title-huge {
    font-size: 32px;
    text-transform: uppercase !important;
  }

  .brand-title {
    margin-top: 2rem !important;
  }

  .premium-btn.desktop-only {
    display: flex !important;
    width: 100%;
    margin-top: 20px;
    margin-bottom: 30px; /* Added spacing */
    justify-content: left;
    background: var(--portal-orange) !important;
    color: #fff !important;
    border: none !important;
    box-shadow: 0 4px 12px rgba(245, 157, 21, 0.3) !important;
  }

  .sheet-corner {
    display: none;
  }

  /* Mobile Card Optimization - Row layout: Info left, Status right */
  .folder-card {
    flex-direction: row;
    align-items: center !important;
    justify-content: space-between;
    gap: 12px;
  }

  .folder-info {
    width: 100%;
  }

  .folder-info .flex {
    flex-wrap: wrap;
    gap: 6px;
  }

  /* Make status/arrow row full width and align right */
  .folder-card > .flex.items-center.gap-3 {
    width: auto; /* Changed from 100% to auto since arrow is gone */
    justify-content: flex-end;
    gap: 12px;
  }

  .folder-arrow {
    display: none !important;
  }

  .status-text {
    display: inline-block !important;
  }

  .status-chip {
    width: auto !important;
    height: auto !important;
    padding: 4px 12px !important;
    border-radius: 9999px !important;
    justify-content: center !important;
    font-size: 10px !important;
    font-weight: 700 !important;
    display: flex !important;
    align-items: center !important;
    gap: 4px !important;
  }

  /* STEPPER MOBILE FIXES */
  .vertical-stepper {
    padding-left: 20px;
    overflow-y: visible;
    height: auto;
  }

  .v-step {
    margin-bottom: 28px !important;
    display: flex !important;
    flex-direction: column !important;
    gap: 8px !important; /* Tightened gap for mobile stack */
    height: auto !important;
    min-height: 0 !important;
  }

  .step-row {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
  }

  .history-btn {
    width: 100% !important;
    height: 40px !important;
    background: rgba(255, 255, 255, 0.05) !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    color: #888 !important;
    display: flex;
    justify-content: center !important;
    gap: 8px;
    border-radius: 6px;
  }

  .history-btn::after {
    content: "VOIR HISTORIQUE";
    font-family: "Montserrat", sans-serif;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.5px;
  }

  .history-btn i {
    width: 14px;
    height: 14px;
  }

  .folder-card {
    padding: 10px 16px !important; /* Match desktop/Tighten for mobile */
  }

  .folder-name {
    font-size: 13px !important;
    margin-bottom: 4px !important; /* Tighten internal spacing */
  }

  .folder-meta {
    font-size: 10.5px !important;
    margin-left: 0 !important;
  }

  .version-chip {
    font-size: 10px !important;
    padding: 1px 6px !important;
  }

  .mobile-sticky-btn {
    display: none !important;
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    z-index: 10000;
    background: var(--portal-orange);
    color: #fff;
    padding: 20px 30px;
    border: none;
    font-family: "Montserrat", sans-serif;
    font-size: 14px;
    font-weight: 700;
    text-transform: uppercase;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.2);
    animation: slideUpBottom 0.5s 1s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    transform: translateY(100%);
  }
}

@keyframes slideUpBottom {
  to {
    transform: translateY(0);
  }
}

.mobile-sticky-btn {
  display: none;
}

.sheet-title-huge {
  font-family: "Montserrat", sans-serif;
  font-size: 42px;
  font-weight: 800;
  letter-spacing: -2px;
  line-height: 1;

  color: #fff;
  text-transform: uppercase;
}
.sheet-subtitle {
  font-size: 42px;
  font-weight: 800;
  letter-spacing: -2px;
  color: transparent;
  -webkit-text-stroke: 1.5px #d4d4d8;
  display: block;
}

.note-label {
  font-family: "JetBrains Mono", monospace;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  color: #999;
  margin-bottom: 12px;
  display: block;
  letter-spacing: 0.5px;
}
.sheet-description {
  font-size: 14px;
  font-weight: 500;
  line-height: 1.6;
  color: #ccc;
  max-width: 340px;
}

.sheet-column-title {
  font-family: "Poppins", sans-serif;
  font-size: 14px;
  font-weight: 600;
  text-transform: none;
  letter-spacing: 0.3px;
  color: #1a1a1a;
  margin-bottom: 15px;
  padding-bottom: 10px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.premium-btn {
  background: #fff;
  color: #000;
  width: 100%;
  padding: 22px 30px;
  border: none;
  font-family: "Montserrat", sans-serif;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: -0.2px;
  display: flex;
  justify-content: space-between;
  align-items: left;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
  overflow: hidden;
  margin-top: 40px;
}
.premium-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 20px -5px rgba(255, 255, 255, 0.2);
  background: #e0e0e0;
}

/* --- VERTICAL STEPPER --- */
.vertical-stepper {
  position: relative;
  padding-left: 0;
  padding-right: 30px; /* Space for custom scroll indicator */
  flex-grow: 1;
  overflow-y: auto;
  max-height: 520px;
  min-height: 0;
  scrollbar-width: none; /* Hide Firefox scrollbar */
  -ms-overflow-style: none; /* Hide IE/Edge scrollbar */
}

/* Hide WebKit scrollbar completely */
.vertical-stepper::-webkit-scrollbar,
.history-view-scroll::-webkit-scrollbar {
  display: none !important;
  width: 0 !important;
  height: 0 !important;
  background: transparent !important;
}
.vertical-stepper,
.history-view-scroll {
  scrollbar-width: none !important;
  -ms-overflow-style: none !important;
}

/* Custom Scroll Indicator - Positioned on far right */
.custom-scroll-track {
  position: absolute;
  right: 0; /* Far right edge */
  top: 20px;
  bottom: 20px;
  width: 4px;
  background: rgba(0, 0, 0, 0.05);
  border-radius: 10px;
  pointer-events: none;
  z-index: 10;
}

.custom-scroll-thumb {
  display: none !important;
  position: absolute;
  right: 0;
  top: 0;
  width: 100%;
  border-radius: 10px;
  opacity: 0.5;
  transition:
    opacity 0.2s,
    height 0.1s;
  cursor: pointer;
  pointer-events: auto;
}

.custom-scroll-thumb:hover,
.custom-scroll-thumb.dragging {
  opacity: 0.8;
}

/* The vertical line - Background (unfilled) */
/* The vertical line - Background (unfilled) */
.vertical-stepper::before {
  content: "";
  position: absolute;
  top: 14px; /* Start at first bullet center (28px/2) */
  left: 8px;
  bottom: 20px; /* Stop at last bullet center (28px row + 6px margin - 14px center = 20px from bottom) */
  width: 2px;
  background: rgba(0, 0, 0, 0.08);
  z-index: 1;
  border-radius: 2px;
}

.vertical-stepper::after {
  content: "";
  position: absolute;
  top: 14px;
  left: 8px;
  width: 2px;
  background: var(
    --progress-bg,
    var(--color-validated)
  ); /* Dynamic: Gradient or Solid */
  z-index: 0;
  border-radius: 2px;
  height: var(--progress-height, 0%);
  max-height: calc(100% - 12px); /* Never exceed last bullet */
  transition: height 1.5s var(--ease-premium);
}

.v-step {
  position: relative;
  margin-bottom: 20px;
  z-index: 1;
  display: flex;
  flex-direction: column;
  gap: 8px; /* Spacing between title and cards, and between cards */
  padding-left: 2px;
}

/* Last step has no bottom margin */
.v-step.end {
  margin-bottom: 0;
}

/* The node dot - Now inside title-row */
.title-row::before {
  content: "";
  flex-shrink: 0;
  width: 12px;
  height: 12px;
  background: #fff;
  border: 2px solid #cbd5e1;
  border-radius: 50%;
  z-index: 2;
  transition: all 0.3s;
  margin-right: 12px;
}

/* Status variants for dots */
/* VALIDATED (Rich Emerald) */
.v-step.done .title-row::before {
  background: var(--color-validated);
  border-color: var(--color-validated);
  box-shadow:
    0 0 16px rgba(5, 150, 105, 0.4),
    0 0 0 3px rgba(5, 150, 105, 0.1);
}
/* ACTIVE (Warm Amber) */
.v-step.active .title-row::before {
  background: var(--color-active);
  border-color: var(--color-active);
  box-shadow:
    0 0 16px rgba(217, 119, 6, 0.4),
    0 0 0 3px rgba(217, 119, 6, 0.1);
}
.v-step.active .v-step-title {
  color: var(--color-active) !important;
  opacity: 1 !important;
}
/* LOCKED (Soft Slate Gray) */
.v-step.locked .title-row::before {
  background: var(--color-locked);
  border-color: var(--color-locked);
  box-shadow: 0 0 8px rgba(148, 163, 184, 0.2);
}
.v-step.locked {
  opacity: 1; /* Reset main opacity to handle children individually if needed */
}
.v-step.locked .v-step-title,
.v-step.locked .folder-card {
  opacity: 0.5;
}

/* ARCHIVED (Refined Red) */
.v-step.archived .title-row::before,
.v-step.rejected .title-row::before {
  background: var(--color-archived);
  border-color: var(--color-archived);
  box-shadow: 0 0 8px rgba(220, 38, 38, 0.2);
}

/* START / END SPECIFIC (CIRCLES) */
.v-step.start .title-row::before,
.v-step.end .title-row::before {
  border-radius: 50%;
  border-width: 2.5px;
  width: 12px;
  height: 12px;
}

/* START (Deep Slate Blue or Green when done) */
.v-step.start .title-row::before {
  background: var(--color-start);
  border-color: var(--color-start);
  box-shadow:
    0 0 16px rgba(51, 65, 85, 0.3),
    0 0 0 3px rgba(51, 65, 85, 0.08);
}

.v-step.start.done .title-row::before {
  background: var(--color-validated);
  border-color: var(--color-validated);
  box-shadow:
    0 0 16px rgba(5, 150, 105, 0.4),
    0 0 0 3px rgba(5, 150, 105, 0.1);
}

.v-step.start .v-step-title {
  color: #0f172a;
  font-weight: 700;
  letter-spacing: 0.1px;
}

.v-step.start.done .v-step-title {
  color: #0f172a;
  font-weight: 700;
  letter-spacing: 0.1px;
}

/* END (Deep Violet or Green when done) */
.v-step.end .title-row::before {
  background: var(--color-end);
  border-color: var(--color-end);
  box-shadow:
    0 0 16px rgba(124, 58, 237, 0.3),
    0 0 0 3px rgba(124, 58, 237, 0.08);
}

.v-step.end.done .title-row::before {
  background: var(--color-validated);
  border-color: var(--color-validated);
  box-shadow:
    0 0 16px rgba(5, 150, 105, 0.4),
    0 0 0 3px rgba(5, 150, 105, 0.1);
}

.v-step.end .v-step-title {
  color: #0f172a;
  font-weight: 700;
  letter-spacing: 0.1px;
}

.v-step.end.done .v-step-title {
  color: #0f172a;
  font-weight: 700;
  letter-spacing: 0.1px;
}

/* Content Container for Step */
.v-step-content {
  display: flex;
  flex-direction: column;
}

.v-step-title {
  font-family: "Poppins", sans-serif;
  font-size: 13px;
  color: #0f172a;
  font-weight: 700;
  text-transform: none;
  display: block;
  line-height: 1.4;
  letter-spacing: 0.1px;
}

/* Title Row - Contains title, badge, and history icon */
.title-row {
  display: flex;
  align-items: center;
  gap: 8px;
  position: relative;
}

/* History button and Accordion trigger in title row */
.history-btn-title,
.accordion-trigger-btn {
  width: 28px;
  height: 28px;
  flex-shrink: 0;
  background: #ffffff;
  border: 1px solid rgba(0, 0, 0, 0.06);
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #94a3b8;
  cursor: pointer;
  transition: all 0.25s var(--ease-premium);
  box-shadow: var(--shadow-sm);
  margin-left: auto;
}

.history-btn-title:hover,
.accordion-trigger-btn:hover {
  background: #f8fafc;
  border-color: rgba(0, 0, 0, 0.12);
  color: #475569;
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}

.accordion-trigger-btn i {
  transition: transform 0.3s ease;
}

.lot-accordion.active .accordion-trigger-btn i {
  transform: rotate(180deg);
  color: #94a3b8; /* Stay gray like history icon */
}

.lot-accordion.active .accordion-trigger-btn {
  border-color: rgba(0, 0, 0, 0.1);
  background: #f8fafc;
}

/* Folder Card (for active/folder items) */
.folder-card {
  margin-left: 24px; /* Ensure card aligns with text start, not bullet */
  background: #ffffff;
  border: 1px solid rgba(0, 0, 0, 0.06);
  border-radius: 8px;
  padding: 10px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  transition: all 0.25s var(--ease-premium);
  text-decoration: none;
  box-shadow: var(--shadow-sm);
}
.folder-card:hover {
  background: #fefefe;
  border-color: rgba(0, 0, 0, 0.12);
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}

/* Status variants for folder-card */
.folder-card.validated,
.folder-card.validated:hover {
  background: #f0fdf4 !important;
  border-color: var(--color-validated) !important;
  box-shadow: none !important;
  transform: none !important;
}
.folder-card.validated .folder-arrow {
  color: var(--color-validated) !important;
  opacity: 1 !important;
}
.folder-card.active,
.folder-card.review {
  background: #fffbeb !important;
  border-color: var(--color-active) !important;
}
.folder-card.active .folder-arrow,
.folder-card.review .folder-arrow {
  color: var(--color-active) !important;
  opacity: 1 !important;
}
/* History View - No Vertical Line */
/* History View - No Vertical Line */
.vertical-stepper.history-view-active::before,
.vertical-stepper.history-view-active::after {
  display: none !important;
}

/* Lot Status Preview (Visible when accordion is closed) */
.lot-status-preview {
  display: none;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  padding: 2px 8px;
  border-radius: 99px;
  margin-left: auto;
  margin-right: 8px; /* Space before chevron */
}

/* Status Colors for Preview */
.lot-status-preview.validated {
  background: #059669; /* Solid Green */
  color: #fff;
  border: 1px solid #059669;
}
.lot-status-preview.active,
.lot-status-preview.review {
  background: #fffbeb;
  color: #d97706;
  border: 1px solid #fde68a;
}
.lot-status-preview.archived,
.lot-status-preview.rejected {
  background: #fef2f2;
  color: #dc2626;
  border: 1px solid #fecaca;
}

/* Show only when accordion is NOT active */
.lot-accordion:not(.active) .lot-status-preview {
  display: inline-block;
}

.folder-card.rejected {
  background: #fef2f2 !important;
  border-color: var(--color-archived) !important;
}
.folder-card.rejected .folder-arrow {
  color: var(--color-archived) !important;
  opacity: 1 !important;
}
.folder-card.archived {
  background: #fef2f2 !important;
  border-color: rgba(220, 38, 38, 0.1) !important;
}

/* Lot Chip */
.lot-chip {
  background: #eff6ff;
  color: #1e40af;
  padding: 2px 8px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 600;
  font-family: "JetBrains Mono", monospace;
  letter-spacing: -0.02em;
  border: 1px solid #dbeafe;
}

/* Version Chip */
.version-chip {
  background: #f1f5f9;
  color: #475569;
  padding: 2px 8px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 600;
  font-family: "JetBrains Mono", monospace;
  letter-spacing: -0.02em;
  border: 1px solid #e2e8f0;
}

/* Placeholder card for upcoming steps */
.folder-card.placeholder {
  background: #fdfdfd;
  border: 1px dashed rgba(0, 0, 0, 0.1);
  box-shadow: none;
  opacity: 0.7;
}
.folder-card.placeholder .folder-name {
  color: #94a3b8;
}
.folder-card.placeholder .folder-arrow {
  opacity: 0.3;
}

.folder-info {
  display: flex;
  flex-direction: column;
}
.folder-name {
  font-family: "Poppins";
  font-size: 13.5px;
  font-weight: 600;
  color: #1e293b;
  letter-spacing: -0.2px;
}
.folder-meta {
  font-size: 11.5px;
  color: #64748b;
  font-family: "Poppins", sans-serif;
  margin-left: 10px;
  font-weight: 500;
  letter-spacing: 0.1px;
}

.folder-arrow {
  color: #cbd5e1;
  transition: all 0.25s var(--ease-premium);
}
.folder-card:hover .folder-arrow {
  color: #1e293b;
  transform: translateX(3px);
}

/* Status variants for Folder Text */
/* VALIDATED (Rich Emerald) */
.v-step.done .folder-meta {
  color: var(--color-validated);
  font-weight: 600;
  font-family: "Poppins", sans-serif;
  letter-spacing: 0.2px;
}
.v-step.done .folder-name {
  color: #1e293b;
  text-decoration: none;
}
.v-step.done .folder-card {
  background: #f0fdf4;
  border-color: var(--color-validated);
  box-shadow: none;
}
.v-step.done .folder-arrow {
  color: var(--color-validated);
  opacity: 1;
}

/* ACTIVE (Warm Amber) */
.v-step.active .folder-meta {
  color: #64748b;
  font-weight: 500;
  font-family: "Poppins", sans-serif;
}
.v-step.active .folder-name {
  color: #0f172a;
  font-weight: 700;
  /* Font size inheriting default 13.5px */
}
.v-step.active .folder-card {
  background: #fffbeb;
  border-color: rgba(217, 119, 6, 0.2);
  box-shadow: 0 4px 16px rgba(217, 119, 6, 0.12);
  /* Padding inherited from default .folder-card (10px 16px) */
}
.v-step.active .folder-arrow {
  color: var(--color-active);
  opacity: 0.;
}
.v-step.active .folder-card:hover .folder-arrow {
  opacity: 1;
  color: var(--color-active);
  transform: translateX(4px);
}

.v-step.active .history-btn {
  background: #fffbeb;
  border-color: rgba(217, 119, 6, 0.15);
  color: var(--color-active);
}
.v-step.active .history-btn:hover {
  background: #fef3c7;
  border-color: rgba(217, 119, 6, 0.3);
  color: var(--color-active);
  box-shadow: var(--shadow-sm);
}

/* Simple text for Start/End */
.v-simple-text {
  font-size: 11px;
  color: #888;
  font-weight: 500;
}

/* --- PROGRESS BAR FOOTER --- */
.sheet-right-footer {
  margin-top: auto;
  padding-top: 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.progress-header {
  display: flex;
  justify-content: space-between;
  font-family: "Poppins", sans-serif;
  font-size: 11.5px;
  font-weight: 500;
  color: #64748b;
  margin-bottom: 12px;
  text-transform: none;
  letter-spacing: 0.2px;
}
.progress-header span:last-child {
  color: #0f172a;
  font-weight: 700;
  letter-spacing: -0.2px;
}

.progress-track {
  width: 100%;
  height: 10px;
  background: linear-gradient(to right, #f1f5f9, #e2e8f0);
  border-radius: 10px;
  overflow: hidden;
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.08);
}
.progress-fill {
  height: 100%;
  background: linear-gradient(
    90deg,
    var(--color-active) 0%,
    var(--color-validated) 100%
  );
  border-radius: 10px;
  transition: width 1.2s var(--ease-premium);
  box-shadow: 0 2px 8px rgba(217, 119, 6, 0.25);
  position: relative;
}

/* --- MILESTONES --- */
.milestone-container {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.milestone-marker {
  position: absolute;
  top: -2px;
  bottom: -2px;
  width: 2px;
  background: #334155;
  z-index: 10;
  opacity: 0.25;
}

.milestone-label {
  position: absolute;
  top: 12px;
  font-family: "Poppins", sans-serif;
  font-size: 10px;
  white-space: nowrap;
  font-weight: 600;
}

.progress-track {
  position: relative;
  overflow: visible;
}

.progress-fill {
  z-index: 1;
  position: relative;
}

/* --- STEP ROW & HISTORY CTA --- */
.step-row {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
}

.history-btn {
  width: 48px;
  height: 48px;
  flex-shrink: 0;
  background: #ffffff;
  border: 1px solid rgba(0, 0, 0, 0.06);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #94a3b8;
  cursor: pointer;
  transition: all 0.25s var(--ease-premium);
  box-shadow: var(--shadow-sm);
}
.history-btn:hover {
  background: #f8fafc;
  border-color: rgba(0, 0, 0, 0.12);
  color: #475569;
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}

/* --- HISTORY VIEW --- */
.history-view {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
  animation: fadeInUp 0.3s ease-out forwards;
}

.history-view-scroll {
  flex: 1;
  overflow-y: auto;
  margin-bottom: 0px;
  padding-right: 8px;
  scrollbar-width: none; /* Hide Firefox scrollbar */
  -ms-overflow-style: none; /* Hide IE/Edge scrollbar */
  min-height: 0;
}

.history-view-scroll::-webkit-scrollbar {
  display: none;
}

.history-header {
  display: flex;
  align-items: center;
  margin-bottom: 20px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
  padding-bottom: 10px;
}
.back-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  background: none;
  border: none;
  color: #64748b;
  font-family: "Montserrat";
  font-size: 11.5px;
  font-weight: 700;
  cursor: pointer;
  text-transform: uppercase;
  transition: all 0.25s var(--ease-premium);
  letter-spacing: 0.5px;
}
.back-btn:hover {
  color: #1e293b;
}

/* --- ACCORDION & CHIPS --- */
.lot-accordion {
  margin-bottom: 20px;
  padding-left: 4px; /* Prevent bullet clipping */
}

.lot-header {
  width: 100%;
  display: flex;
  align-items: center;
  padding: 8px 0; /* Slightly tighter */
  background: none;
  border: none;
  cursor: pointer;
  transition: opacity 0.2s;
}

/* Lot Header Bullet Styling - Status Specific */
.lot-header .title-row::before {
  border-color: #cbd5e1;
  background: #fff;
}
.lot-accordion.active .lot-header .title-row::before {
  background: var(--color-active);
  border-color: var(--color-active);
  box-shadow:
    0 0 16px rgba(217, 119, 6, 0.4),
    0 0 0 3px rgba(217, 119, 6, 0.1);
}
.lot-accordion.validated .lot-header .title-row::before {
  background: var(--color-validated);
  border-color: var(--color-validated);
  box-shadow:
    0 0 16px rgba(5, 150, 105, 0.4),
    0 0 0 3px rgba(5, 150, 105, 0.1);
}
.lot-accordion.archived .lot-header .title-row::before {
  background: var(--color-archived);
  border-color: var(--color-archived);
}

.lot-content {
  display: none;
  padding-top: 4px; /* Reduced from 15px */
  padding-left: 0;
  list-style: none;
}

.lot-accordion.active .lot-content {
  display: block;
}

.status-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  border-radius: 9999px;
  font-family: "Poppins", sans-serif;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-left: 8px;
  border: 1px solid transparent;
  transition: all 0.2s;
  flex-shrink: 0;
  line-height: 1.2;
}

.count-badge {
  font-family: "Poppins", sans-serif;
  font-size: 9px;
  font-weight: 600;
  background: #f1f5f9;
  color: #64748b;
  padding: 2px 7px;
  border-radius: 6px;
  margin-left: 8px;
  border: 1px solid #e2e8f0;
  vertical-align: middle;
  letter-spacing: 0.2px;
}

.history-header .count-badge {
  background: #fffbeb;
  color: var(--color-active);
  border-color: rgba(217, 119, 6, 0.2);
  font-size: 10px;
  font-weight: 700;
}
.status-chip.active,
.status-chip.review {
  background: rgba(217, 119, 6, 0.05) !important;
  color: #d97706 !important;
  border: 1px solid rgba(217, 119, 6, 0.4) !important;
}
.status-chip.validated {
  background: #059669 !important;
  color: #fff !important;
  border: 1px solid #059669 !important;
}
.status-chip.archived,
.status-chip.rejected {
  background: rgba(220, 38, 38, 0.04) !important;
  color: #dc2626 !important;
  border: 1px solid rgba(220, 38, 38, 0.3) !important;
}

/* Enhanced Alert Styling */
.alert-disclaimer {
  background: rgba(245, 157, 21, 0.05); /* Very subtle orange tint */
  border-radius: 2px 4px 4px 2px;
}

.alert-title {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--portal-orange);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 8px;
}

.status-text {
  display: inline;
}
/* --- AUTHENTICATION SCREEN --- */
/* Full Page Centering for Auth */
.auth-page-wrapper {
  min-height: 100vh;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  box-sizing: border-box;
}

.auth-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: url("https://www.uteek.net/sites/default/files/images/uteek-digital.png")
    no-repeat center center;
  background-size: cover;
  z-index: 20000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.auth-card {
  max-width: 450px;
  width: 100%;
  background: #000;
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow:
    0 40px 80px -20px rgba(0, 0, 0, 0.8),
    0 0 0 1px rgba(255, 255, 255, 0.05);
  padding: 30px; /* Reduced padding */
  text-align: left; /* Left align everything by default */
  animation: fadeInUp 0.8s var(--ease-out-expo) forwards;
  border-radius: 5px;
}

/* Header Row Layout */
.auth-header-row {
  display: flex;
  align-items: center; /* Center vertically */
  gap: 20px;
  margin-bottom: 25px;
}

.auth-header-info {
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.auth-logo {
  width: 48px;
  margin: 0;
  display: block;
}

/* Meta Line (Ref + Contact) */
.auth-meta-line {
  display: flex;
  align-items: center;
  gap: 15px; /* Increased gap */
}

.project-ref {
  font-family: "Poppins", sans-serif;
  color: #fff !important;
  font-weight: 500;
  font-size: 9px; /* Reduced from 11px */
  letter-spacing: 0.5px;
  white-space: nowrap;
  opacity: 0.8;
}

.auth-project-title {
  font-family: "Montserrat", sans-serif;
  font-size: 24px; /* Increased from 20px */
  font-weight: 900;
  color: var(--portal-orange);
  margin-top: 0; /* Removing unwanted top margin */
  margin-bottom: 5px;
  line-height: 1;
  text-align: left;
}

/* Override existing title style if needed or just replace valid blocks */
.auth-title {
  display: none; /* Hide old title class if still present */
}

.auth-subtitle {
  font-size: 12px;
  color: #bbb; /* Lighter grey for better visibility */
  margin-bottom: 25px;
  line-height: 1.4;
  text-align: left;
}

.auth-inputs {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 25px;
  width: 100%;
}

.auth-digit {
  flex: 1; /* Occupy full available width */
  aspect-ratio: 45 / 60;
  max-width: 45px;
  height: auto;
  min-height: 50px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 4px;
  color: #fff;
  font-family: "JetBrains Mono", monospace;
  font-size: 20px;
  font-weight: 700;
  text-align: center;
  outline: none;
  transition: all 0.2s;
  padding: 0;
}

@media (max-width: 600px) {
  .auth-header-row {
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 15px;
    margin-bottom: 20px;
  }

  .auth-header-info {
    align-items: center;
  }

  .auth-project-title {
    font-size: 22px;
    text-align: center;
  }

  .auth-meta-line {
    justify-content: center;
  }

  .project-contact-card.auth-capsule {
    margin: 0 auto !important;
    width: 100%;
    max-width: 200px;
    justify-content: center;
    padding: 8px 15px;
  }

  .auth-subtitle {
    text-align: center;
  }

  .auth-inputs {
    gap: 6px;
  }

  .auth-digit {
    font-size: 18px;
    min-height: 45px;
  }

  .auth-footer {
    flex-direction: column;
    gap: 10px;
    text-align: center;
  }
}

.auth-digit:focus {
  border-color: var(--portal-orange);
  background: rgba(255, 255, 255, 0.08);
  box-shadow: 0 0 15px rgba(245, 157, 21, 0.2);
}

.auth-digit.error {
  border-color: var(--portal-red);
  animation: shake 0.4s ease-in-out;
}

@keyframes shake {
  0%,
  100% {
    transform: translateX(0);
  }
  25% {
    transform: translateX(-5px);
  }
  75% {
    transform: translateX(5px);
  }
}

.auth-footer {
  font-family: "JetBrains Mono", monospace;
  font-size: 10px;
  color: #666;
  text-transform: uppercase;
  letter-spacing: 1px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 20px;
}

.auth-footer .project-ref {
  color: #fff !important; /* Force white color */
  font-weight: 700;
}

.auth-contact-mini {
  display: none; /* Deprecated */
}

/* Auth Capsule - Identical to Header Icons */
.project-contact-card.auth-capsule {
  margin-top: 0;
  padding: 6px 14px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 100px;
  display: flex;
  flex-direction: row;
  width: auto;
  backdrop-filter: blur(4px);
  gap: 0;
}

.project-contact-card.auth-capsule .contact-links {
  display: flex;
  flex-direction: row;
  gap: 12px;
  align-items: center;
}

.project-contact-card.auth-capsule .contact-item {
  color: #fff;
  opacity: 0.9;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.project-contact-card.auth-capsule .contact-item:hover {
  color: var(--portal-orange);
  opacity: 1;
  transform: translateY(-1px);
}

.project-contact-card.auth-capsule .contact-item i {
  width: 16px; /* Slightly larger used in header */
  height: 16px;
}

/* --- DUAL AUTH STYLES --- */
.auth-form-standard {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 20px;
}

.auth-input-group {
  position: relative;
  text-align: left;
}

.auth-input-label {
  display: block;
  font-family: "JetBrains Mono", monospace;
  font-size: 10px;
  color: #bbb; /* Lighter grey */
  text-transform: uppercase;
  margin-bottom: 6px;
  letter-spacing: 0.5px;
}

.auth-field {
  width: 100%;
  box-sizing: border-box; /* Fix overflow issues */
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 4px;
  padding: 12px 16px;
  color: #fff;
  font-family: "Poppins", sans-serif;
  font-size: 14px;
  outline: none;
  transition: all 0.2s;
}

.auth-field:focus {
  border-color: var(--portal-orange);
  background: rgba(255, 255, 255, 0.08);
  box-shadow: 0 0 15px rgba(245, 157, 21, 0.1);
}

.password-toggle-btn:hover {
  color: #fff !important;
}

.field-error-msg {
  display: block;
  font-family: "JetBrains Mono", monospace;
  font-weight: 500;
  line-height: 1.4;
  animation: fadeInUp 0.3s var(--ease-out-expo);
  color: #ff6b6b;
  font-size: 11px;
  margin-top: 12px;
  text-align: center;
}

.auth-submit-btn {
  background: var(--portal-orange);
  color: #fff;
  border: none;
  border-radius: 4px;
  padding: 20px;
  font-family: "Montserrat", sans-serif;
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 1px;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  margin-top: 5px;
}

.auth-submit-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 20px -5px rgba(245, 157, 21, 0.3);
  filter: brightness(1.1);
}

.auth-submit-btn:disabled {
  opacity: 0.5;
  cursor: wait;
  transform: none;
}

.auth-separator {
  display: flex;
  align-items: center;
  gap: 15px;
  margin: 20px 0;
  color: #bbb; /* Lighter grey */
  font-family: "JetBrains Mono", monospace;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  width: 100%;
}

.auth-separator::before,
.auth-separator::after {
  content: "";
  flex: 1;
  height: 1px;
  background: rgba(255, 255, 255, 0.3);
}

/* Fixed Mobile Button Removal */
#mobile-latest-btn {
  display: none !important;
}

/* Ensure Desktop Button visibility on mobile if needed */
/* Assuming .latest-btn or #latest-ver-btn is the desktop one */
@media (max-width: 768px) {
  /* If sheet-left is hidden, we might need to move the button or show it */
  /* For now, just hiding the fixed one as requested */
}
/* --- CONTACT CARD STYLES --- */
.project-contact-card {
  margin-top: 30px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  padding: 12px 16px;
  transition: all 0.3s var(--ease-premium);
  display: inline-block; /* Avoid full width if not needed */
}

.project-contact-card:hover {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.2);
  transform: translateY(-2px);
}

.contact-name {
  display: block;
  font-family: "Montserrat", sans-serif;
  font-size: 16px;
  font-weight: 800;
  color: #fff;
  margin-bottom: 12px;
}

.contact-links {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.contact-row {
  display: flex;
  gap: 12px;
}

.contact-item {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #ccc;
  font-size: 12px;
  text-decoration: none;
  transition: color 0.2s;
}

.contact-item i {
  width: 14px;
  height: 14px;
  opacity: 0.6;
}

.contact-item:hover {
  color: var(--portal-orange);
}

.contact-item:hover i {
  opacity: 1;
}

.contact-item.whatsapp:hover {
  color: #25d366;
}

/* --- SHARED FOLDER LINK --- */
.shared-folder-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  color: #ccc;
  font-size: 12px;
  text-decoration: none;
  transition: all 0.2s ease;
}

.shared-folder-link:hover {
  background: rgba(255, 255, 255, 0.1);
  color: var(--portal-orange);
  border-color: var(--portal-orange);
}

.shared-folder-link:hover i {
  opacity: 1;
}

.contact-item.folder-link:hover {
  color: var(--portal-orange);
}

/* Mobile Folder Icon (Independent) */
.mobile-folder-icon {
  display: none;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 50%;
  color: #fff;
  text-decoration: none;
  transition: all 0.2s ease;
}

.mobile-folder-icon i {
  width: 18px;
  height: 18px;
  opacity: 0.9;
}

.mobile-folder-icon:active {
  transform: scale(0.9);
  opacity: 0.7;
}

/* Contact Card - Updated */
.project-contact-card {
  width: 100%;
  padding: 1rem;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

@media (max-width: 900px) {
  .mobile-folder-icon {
    display: flex !important;
  }

  .mobile-header-icons .project-contact-card {
    margin-top: 0;
    padding: 8px 16px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 100px;
    flex-direction: row;
    width: auto; /* Reset width for mobile capsule */
  }

  .mobile-header-icons .project-contact-card .contact-links {
    flex-direction: row;
    gap: 16px;
    align-items: center;
  }

  .mobile-header-icons .project-contact-card .contact-item i {
    width: 20px;
    height: 20px;
    opacity: 0.9;
    color: #fff;
  }

  .folder-block,
  .contact-block {
    display: block !important;
    width: 100%;
  }

  .folder-block {
    margin-top: 1.5rem !important;
  }

  .sheet-left-bottom {
    display: flex !important;
    flex-direction: column;
    gap: 1.25rem;
    margin-top: 2rem; /* Increased to add space after description */
    padding-bottom: 2rem;
  }

  .progress-track-container {
    margin-bottom: 20px !important;
  }
}

.back-btn-portal {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  transition: all 0.3s ease;
  flex-shrink: 0;
}

.back-btn-portal:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: var(--portal-orange);
}

.back-btn-portal:hover i {
  color: var(--portal-orange) !important;
  transform: translateX(-2px);
}

/* Responsive Positioning */
.mobile-only-header {
  display: none !important;
}

@media (max-width: 900px) {
  .mobile-only-header {
    display: block !important;
  }
}

/* Phase Details Active State (Desktop) */
@media (min-width: 901px) {
  .sheet-container.phase-details-active .desktop-header-icons {
    display: flex !important;
  }
}

.desktop-header-icons .mobile-folder-icon {
  display: none !important;
}

.sheet-container.phase-details-active .sheet-subtitle {
  display: none !important;
}

.sheet-container.phase-details-active .contact-block.desktop-only {
  display: none !important;
}

.desktop-header-icons .project-contact-card {
  margin-top: 0;
  padding: 8px 16px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 100px;
  flex-direction: row;
  width: auto;
  backdrop-filter: blur(4px);
}

.desktop-header-icons .project-contact-card .contact-links {
  flex-direction: row;
  gap: 16px;
  align-items: center;
}

.desktop-header-icons .project-contact-card .contact-item i {
  width: 20px;
  height: 20px;
  opacity: 0.9;
  color: #fff;
}

@media (max-width: 900px) {
  .desktop-only {
    display: none !important;
  }

  .mobile-only,
  .mobile-only-header {
    display: block !important;
  }

  /* Mobile Header Icons - horizontal layout */
  .mobile-header-icons.mobile-only {
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    gap: 12px !important;
  }

  .mobile-folder-icon {
    display: flex !important;
  }

  .mobile-header-icons .project-contact-card {
    margin-top: 0;
    padding: 8px 16px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 100px;
    backdrop-filter: blur(4px);
  }

  .mobile-header-icons .project-contact-card .contact-links {
    flex-direction: row;
    gap: 16px;
    align-items: center;
  }

  .mobile-header-icons .project-contact-card .contact-item i {
    width: 20px;
    height: 20px;
    opacity: 0.9;
    color: #fff;
  }
}
/* --- PREMIUM HOME GRID STYLES --- */
/* --- PREMIUM SIDEBAR PROJECT LIST & CIRCULAR PROGRESS --- */
.home-grid-container.sheet-container {
  max-width: 1200px;
  display: flex;
  overflow: hidden;
  height: 100vh;
}

.home-grid-container .sheet-left {
  width: 32%;
  flex-shrink: 0;
  display: flex !important;
  flex-direction: column !important;
  height: 100vh !important;
  padding: 30px !important;
  overflow: hidden !important; /* Prevent parent from scrolling, children should handle it */
}

.sheet-left-top {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.projects-sidebar-list {
  flex: 1;
  min-height: 0;
}

.home-grid-container .sheet-right {
  width: 68%;
  flex-grow: 1;
  background: #fff;
  overflow: hidden;
}

/* Sidebar Project Card - Shared File Inspired */
.sidebar-project-card {
  display: flex !important;
  align-items: center;
  padding: 12px 14px;
  background: rgba(255, 255, 255, 0.03);
  border: 2px solid rgba(255, 255, 255, 0.05);
  border-radius: 14px;
  transition: all 0.3s var(--ease-premium);
  text-decoration: none !important;
  color: inherit !important;
  position: relative;
  overflow: hidden;
}

.card-thumb-small {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  background: #111;
  overflow: hidden;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.card-thumb-small img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.thumb-placeholder-small {
  color: #333;
}

.card-info-compact {
  margin-left: 12px;
  padding-right: 36px; /* Space for the absolute progress bar */
  flex-grow: 1;
  min-width: 0;
}

.sidebar-project-card .title {
  font-family: "Poppins", sans-serif !important;
  font-size: 13px !important;
  font-weight: 700 !important;
  color: #fff !important;
  margin: 0 !important;
  line-height: 1.2 !important;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  background: none !important;
  padding: 0 !important;
  text-transform: capitalize;
}

.sidebar-project-card .meta {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 9px !important;
  color: rgba(255, 255, 255, 0.3) !important;
  margin-top: 3px !important;
  font-weight: 600 !important;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Circular Progress Bar - Absolute Top Right */
.card-circular-progress {
  width: 20px;
  height: 20px;
  position: absolute !important;
  top: 10px;
  right: 12px;
  flex-shrink: 0;
}

.circular-svg {
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}

.circle-bg {
  fill: none;
  stroke: rgba(255, 255, 255, 0.08);
  stroke-width: 2.2;
}

.circle-fill {
  fill: none;
  stroke-width: 2.2;
  stroke-linecap: round;
  transition: stroke-dasharray 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.status-icon-center {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  display: flex;
  align-items: center;
  justify-content: center;
}

.status-icon-center i {
  width: 14px !important;
  height: 14px !important;
  stroke-width: 3px;
}

/* Color Tokens for Circular Progress & Icons */
.color-emerald {
  color: #10b981 !important;
  stroke: #10b981 !important;
}
.color-amber {
  color: #f97316 !important;
  stroke: #f97316 !important;
}
.color-blue {
  color: #3b82f6 !important;
  stroke: #3b82f6 !important;
}
.color-lime {
  color: #00ffbd !important;
  stroke: #00ffbd !important;
}
.color-yellow {
  color: #fbbf24 !important;
  stroke: #fbbf24 !important;
}
.color-white {
  color: #ffffff !important;
  stroke: #ffffff !important;
}
.color-rose {
  color: #f43f5e !important;
  stroke: #f43f5e !important;
}
.color-slate {
  color: #64748b !important;
  stroke: #64748b !important;
}

/* Dynamic Border Colors for Cards */
.sidebar-project-card {
  border: 1px solid rgba(249, 115, 22, 0.4) !important;
}

.sidebar-project-card.border-emerald:hover {
  border-color: rgba(16, 185, 129, 0.8) !important;
}
.sidebar-project-card.border-amber:hover {
  border-color: rgba(249, 115, 22, 0.8) !important;
}
.sidebar-project-card.border-blue:hover {
  border-color: rgba(59, 130, 246, 0.8) !important;
}
.sidebar-project-card.border-lime:hover {
  border-color: rgba(0, 255, 189, 0.9) !important;
}
.sidebar-project-card.border-yellow:hover {
  border-color: rgba(251, 191, 36, 0.8) !important;
}
.sidebar-project-card.border-white:hover {
  border-color: rgba(255, 255, 255, 0.8) !important;
}
.sidebar-project-card.border-slate:hover {
  border-color: rgba(100, 116, 139, 0.8) !important;
}
.sidebar-project-card.border-rose:hover {
  border-color: rgba(244, 63, 94, 0.4) !important;
  background: rgba(244, 63, 94, 0.15) !important;
}

.maintenance-shield {
  position: absolute;
  bottom: -23px;
  right: 4px;
  color: #00ffbd !important;
  border-radius: 4px;
  width: 15px;
  height: 15px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.5);
  z-index: 20;
}

.maintenance-shield .dashicons {
  font-size: 20px;
  width: 11px;
  height: 11px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  margin: 0;
}

/* Scrollbar Hide */
.scrollbar-hide::-webkit-scrollbar {
  display: none;
}
.scrollbar-hide {
  -ms-overflow-style: none;
  scrollbar-width: none;
}

/* Activity List Premium styles */
.history-view-active .v-step {
  padding-bottom: 24px !important;
}

.history-view-active .v-step::after {
  left: -24px !important;
  width: 1px !important;
  background-color: #f1f5f9 !important;
}

@media (max-width: 900px) {
  .home-grid-container.sheet-container {
    flex-direction: column;
    height: auto;
    max-height: none;
    overflow-y: visible;
  }
  .home-grid-container .sheet-left,
  .home-grid-container .sheet-right {
    width: 100%;
    height: auto !important;
  }
  .projects-sidebar-list {
    max-height: none;
  }
}

/* --- Tickets View Styling --- */
.tickets-view {
  animation: fadeInUp 0.6s var(--ease-premium) forwards;
}

/* Ticket Card - Specific Overrides for file-item structure */
.tickets-view .file-item.ticket-card {
  padding: 0 !important;
  transition:
    transform 0.3s var(--ease-premium),
    box-shadow 0.3s var(--ease-premium);
  background: white;
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 12px;
  overflow: hidden;
}

.tickets-view .file-item.ticket-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 30px -10px rgba(0, 0, 0, 0.12);
  border-color: rgba(0, 0, 0, 0.12);
}

.tickets-view .ticket-card .preview-container {
  width: 100%;
  overflow: hidden;
  background: #f8fafc;
  display: flex;
  align-items: center;
  justify-content: center;
}

.tickets-view .ticket-card .preview-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s var(--ease-premium);
}

.tickets-view .file-item.ticket-card:hover .preview-img {
  transform: scale(1.05);
}

.tickets-view .ticket-card .item-name {
  padding: 14px 12px;
  font-weight: 600;
  color: #1e293b;
  width: 100%;
  font-size: 13px;
  line-height: 1.4;
  border-top: 1px solid rgba(0, 0, 0, 0.04);
}

/* Ticket & Media Tags (.type-chip style) */
.type-chip {
  padding: 3px 12px;
  border-radius: 50px;
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  pointer-events: none;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: normal;
}

/* Status variants */
.type-chip.status-new {
  background: #3b82f6;
  color: #fff;
}
.type-chip.status-in-progress {
  background: #f59e0b;
  color: #fff;
}
.type-chip.status-resolved {
  background: #10b981;
  color: #fff;
}
.type-chip.status-closed {
  background: #6b7280;
  color: #fff;
}
.type-chip.status-rejected {
  background: #ef4444;
  color: #fff;
}

/* Priority variants */
.type-chip.priority-critical,
.type-chip.priority-high {
  background: #ff0033;
  color: #fff;
  box-shadow: 0 0 10px rgba(255, 0, 51, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.type-chip.priority-critical i,
.type-chip.priority-critical svg,
.type-chip.priority-critical [data-lucide],
.type-chip.priority-high i,
.type-chip.priority-high svg,
.type-chip.priority-high [data-lucide],
.priority-icon-blink {
  animation: badge-blink 1.5s infinite;
}

@keyframes badge-blink {
  0%,
  100% {
    opacity: 1;
    transform: scale(1);
  }
  50% {
    opacity: 0.2;
    transform: scale(0.85);
  }
}

.type-chip.priority-medium {
  background: #f59e0b;
  color: #fff;
}
.type-chip.priority-low {
  background: #10b981;
  color: #fff;
}

/* Type variants (Subtle background tint) */
.type-chip.ticket-bug {
  border: 1.5px solid #f43f5e;
  color: #f43f5e;
  background: rgba(244, 63, 94, 0.1);
}
.type-chip.ticket-feature {
  border: 1.5px solid #6366f1;
  color: #6366f1;
  background: rgba(99, 102, 241, 0.1);
}
.type-chip.ticket-task {
  border: 1.5px solid #3b82f6;
  color: #3b82f6;
  background: rgba(59, 130, 246, 0.1);
}
.type-chip.ticket-improvement {
  border: 1.5px solid #10b981;
  color: #10b981;
  background: rgba(16, 185, 129, 0.1);
}
.type-chip.ticket-support {
  border: 1.5px solid #f59e0b;
  color: #f59e0b;
  background: rgba(245, 158, 11, 0.1);
}

.type-chip.design {
  border: 1.5px solid #ec4899;
  color: #ec4899;
  background: rgba(236, 72, 153, 0.15);
}
.type-chip.fonctionnel {
  border: 1.5px solid #ef4444;
  color: #ef4444;
  background: rgba(239, 68, 68, 0.15);
}
.type-chip.contenu {
  border: 1.5px solid #3b82f6;
  color: #3b82f6;
  background: rgba(59, 130, 246, 0.15);
}

/* Backward compatibility for listing pages if they use media class */
.type-chip.media {
  background: rgba(244, 63, 94, 0.85);
  color: #fff;
}

.type-chip.lien {
  background: #6366f1;
  color: #fff;
}
.type-chip.file {
  background: #6b7280;
  color: #fff;
}

/* Hover Overlay Refinements */
.ticket-card .item-overlay {
  backdrop-filter: blur(12px);
  background-color: rgba(0, 0, 0, 0.75) !important;
}

.ticket-card:hover .type-chip.absolute {
  opacity: 0;
  pointer-events: none;
}

/* Off-canvas Scrollbar styling for a cleaner look */
#ticket-details-content::-webkit-scrollbar {
  width: 6px;
}

#ticket-details-content::-webkit-scrollbar-track {
  background: transparent;
}

#ticket-details-content::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 10px;
}

#ticket-details-content::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.2);
}

.tickets-view h3 {
  font-family: "Poppins", sans-serif;

  letter-spacing: -0.02em;
}

.track-files-badge {
  background: rgba(255, 255, 255, 0.05);
  padding: 2px 8px;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

/* Masonry support for ticket cards */
.mode-pinterest .masonry-column .ticket-card {
  margin-bottom: 1.5rem;
}

@media (max-width: 768px) {
  .tickets-view {
    padding: 1.5rem !important;
  }
}

/* --- TICKET DETAILS REDESIGN --- */

.ticket-content h4 {
  font-family: "Montserrat", sans-serif;
  color: #fff;
  opacity: 0.9;
  font-weight: 700;
  letter-spacing: 1px;
}

/* Range Slider Premium Styles */
#detail-progress {
  -webkit-appearance: none;
  appearance: none;
  background: transparent;
}

#detail-progress::-webkit-slider-runnable-track {
  background: #27272a;
  height: 4px;
  border-radius: 9999px;
  border: none;
}

#detail-progress::-webkit-slider-thumb {
  -webkit-appearance: none;
  height: 12px;
  width: 12px;
  border-radius: 50%;
  background: #3b82f6; /* Default, overridden in JS if needed */
  margin-top: -4px;
  cursor: pointer;
  border: 2px solid #09090b;
  box-shadow: 0 0 10px rgba(59, 130, 246, 0.4);
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

#detail-progress:hover::-webkit-slider-thumb {
  transform: scale(1.2);
  box-shadow: 0 0 15px rgba(59, 130, 246, 0.6);
}

/* Core Issue & Context Blocks */
.core-issue-box {
  background: transparent;
  border: none;
}

.ticket-content .prose-invert {
  font-size: 13px;
  line-height: 1.7;
  background: transparent; /* Remove background */
  border: none; /* Remove border */
  text-align: left; /* Ensure left alignment for description */
}

.ticket-content .prose-invert p {
  margin-bottom: 1em;
}

/* Custom Scrollbar for Offcanvas */
.custom-scrollbar::-webkit-scrollbar {
  width: 5px;
}

.custom-scrollbar::-webkit-scrollbar-track {
  background: transparent;
}

.custom-scrollbar::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 10px;
}

.custom-scrollbar::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.2);
}

/* Select Inputs Refinement */
#detail-type,
#detail-category,
#detail-priority {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%2371717a' stroke-width='2'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' d='M19 9l-7 7-7-7'%3E%3C/path%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.5rem center;
  background-size: 1rem;
  padding-right: 2rem;
  appearance: none;
}

#detail-priority {
  padding-left: 2rem; /* Space for absolute icon */
}

/* Redesigned Gallery Toggle */
#toggle-gallery-btn {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

#toggle-gallery-btn:active {
  transform: scale(0.95);
}

/* Section Header Underline Decoration */
.detail-section-header::after {
  content: "";
  display: block;
  width: 24px;
  height: 2px;
  background: #3b82f6;
  margin-top: 8px;
  border-radius: 2px;
}

/* Links in details */
.ticket-content a:hover i {
  transform: translateX(2px) translateY(-2px);
  transition: transform 0.2s ease;
}
