@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 */
  --yadoum-orange: #d97706;
  --yadoum-green: #059669;
  --yadoum-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;
}
.mobile-only {
  display: none !important;
}

@media (max-width: 900px) {
  .desktop-only {
    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 {
  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.8s var(--ease-out-expo) forwards;
  animation-delay: 0.1s;
  overflow: hidden;
  display: flex;
  height: 85vh; /* Fixed height for stability */
  max-height: 85vh;
  border-radius: 4px;
  display: none; /* Hidden until auth */
}

/* 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 {
    padding: 0;
    min-height: 100vh;
  }

  .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: #000;
    padding-bottom: 0;
    box-shadow: none !important;
    border: none !important;
    display: none; /* Hidden until auth */
  }

  .sheet-left,
  .sheet-right {
    width: 100%;
    padding: 20px;
    height: auto;
    border: none;
  }

  .sheet-left {
    padding-bottom: 20px;
  }

  .sheet-right {
    padding-top: 20px;
    padding-bottom: 30px;
    background: #ffffff;
    flex-grow: 1;
  }

  .sheet-title-huge {
    font-size: 32px;
  }

  .premium-btn.desktop-only {
    display: flex !important;
    width: 100%;
    margin-top: 20px;
    margin-bottom: 30px; /* Added spacing */
    justify-content: left;
    background: var(--yadoum-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: 3px 8px !important;
    border-radius: 6px !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(--yadoum-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;
}
.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 {
  display: none;
}

/* 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 {
  position: absolute;
  right: 0;
  top: 0;
  width: 100%;
  background: var(--color-active);
  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);
}
/* LOCKED (Soft Slate Gray) */
.v-step.blocked .title-row::before {
  background: var(--color-locked);
  border-color: var(--color-locked);
  box-shadow: 0 0 8px rgba(148, 163, 184, 0.2);
}

/* ARCHIVED (Refined Red) */
.v-step.archived .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 {
  background: #f0fdf4 !important;
  border-color: rgba(5, 150, 105, 0.15) !important;
}
.folder-card.active {
  background: #fffbeb !important;
  border-color: rgba(217, 119, 6, 0.15) !important;
}
.folder-card.archived {
  background: #fef2f2 !important;
  border-color: rgba(220, 38, 38, 0.1) !important;
}

/* 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: rgba(5, 150, 105, 0.15);
  box-shadow: 0 2px 8px rgba(5, 150, 105, 0.08);
}

/* 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.4;
}
.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 {
  font-family: "Poppins", sans-serif;
  font-size: 10px;
  font-weight: 600;
  padding: 5px 14px;
  border-radius: 100px;
  text-transform: none;
  margin-left: 8px;
  margin-right: 0px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  letter-spacing: 0.2px;
  border: 1px solid transparent;
}

.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 {
  background: #fffbeb;
  color: var(--color-active);
  border-color: rgba(217, 119, 6, 0.2);
}
.status-chip.validated {
  background: var(--color-validated);
  color: #fff;
  border-color: transparent;
}
.status-chip.archived {
  background: #fef2f2;
  color: var(--color-archived);
  border-color: rgba(220, 38, 38, 0.2);
}

/* 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(--yadoum-orange);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 8px;
}

.status-chip {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 8px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  transition: all 0.2s;
  flex-shrink: 0;
  border: 1px solid transparent;
}

.status-text {
  display: inline;
}
/* --- AUTHENTICATION SCREEN --- */
.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: 400px;
  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: 40px;
  text-align: center;
  animation: fadeInUp 0.8s var(--ease-out-expo) forwards;
}

.auth-logo {
  width: 64px;
  margin: 0 auto 30px;
  display: block;
}

.auth-project-title {
  font-family: "Montserrat", sans-serif;
  font-size: 32px;
  font-weight: 900;
  color: var(--yadoum-orange);
  letter-spacing: -1px;
  margin-bottom: 4px;
}

.auth-title {
  font-family: "Montserrat", sans-serif;
  font-size: 20px;
  font-weight: 800;
  color: #fff;
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.auth-subtitle {
  font-size: 13px;
  color: #888;
  margin-bottom: 30px;
  line-height: 1.5;
}

.auth-inputs {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-bottom: 30px;
  width: 100%;
}

.auth-digit {
  width: 14%;
  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: 400px) {
  .auth-card {
    padding: 30px 20px;
  }
  .auth-inputs {
    gap: 6px;
  }
  .auth-digit {
    font-size: 18px;
  }
}

.auth-digit:focus {
  border-color: var(--yadoum-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(--yadoum-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;
}

/* 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(--yadoum-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(--yadoum-orange);
    border-color: var(--yadoum-orange);
}

.shared-folder-link i {
    opacity: 0.7;
}

.shared-folder-link:hover i {
    opacity: 1;
}

.contact-item.folder-link:hover {
    color: var(--yadoum-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;
    }
}

/* Responsive Positioning */
.mobile-only, .mobile-only-header {
    display: none !important;
}

@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;
    }
}

