:root {
  --primary-color: #1B5E20; /* Deep green */
  --primary-light: #4CAF50;
  --secondary-color: #E8F5E9;
  --background-dark: #121212;
  --surface-dark: rgba(255, 255, 255, 0.05);
  --border-dark: rgba(255, 255, 255, 0.1);
  --text-primary: #FFFFFF;
  --text-secondary: #B0BEC5;
  --error: #CF6679;
  --success: #4CAF50;
}

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

html {
  overflow-x: hidden;
  max-width: 100vw;
  width: 100%;
  height: 100%;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  background-color: var(--background-dark);
  color: var(--text-primary);
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  max-width: 100vw;
  width: 100%;
  position: relative;
  background-image: 
    radial-gradient(circle at 15% 50%, rgba(27, 94, 32, 0.15), transparent 25%),
    radial-gradient(circle at 85% 30%, rgba(76, 175, 80, 0.1), transparent 25%);
}

.container,
main,
.home-container {
  flex: 1 0 auto;
  display: flex;
  flex-direction: column;
  box-sizing: border-box;
}

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

footer {
  margin-top: auto !important;
  width: 100%;
}

.hero {
  text-align: center;
  padding: 4rem 0;
}

.hero h1 {
  font-size: 3rem;
  font-weight: 800;
  margin-bottom: 1rem;
  background: linear-gradient(135deg, #fff, var(--primary-light));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  letter-spacing: -0.05em;
}

.hero p {
  font-size: 1.25rem;
  color: var(--text-secondary);
  max-width: 600px;
  margin: 0 auto 2rem;
}

/* Glassmorphism Card */
.glass-card {
  background: var(--surface-dark);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--border-dark);
  border-radius: 16px;
  padding: 2.5rem;
  box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

/* Form Styles */
.form-group {
  margin-bottom: 1.5rem;
  display: flex;
  flex-direction: column;
  text-align: left;
}

.form-group label {
  font-weight: 600;
  margin-bottom: 0.5rem;
  font-size: 0.9rem;
  color: var(--text-secondary);
}

.form-control {
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid var(--border-dark);
  border-radius: 8px;
  padding: 0.75rem 1rem;
  color: var(--text-primary);
  font-size: 1rem;
  transition: all 0.2s ease;
  font-family: inherit;
}

select.form-control,
select {
  background-color: rgba(18, 24, 20, 0.6);
  color: var(--text-primary);
  border: 1px solid var(--border-dark);
  cursor: pointer;
}

select option {
  background-color: #121914;
  color: var(--text-primary);
}

select option:checked,
select option:hover {
  background-color: var(--primary-color) !important;
  color: #ffffff !important;
}

.form-control:focus {
  outline: none;
  border-color: var(--primary-light);
  background: rgba(0, 0, 0, 0.4);
  box-shadow: 0 0 0 2px rgba(76, 175, 80, 0.2);
}

input[type="file"].form-control {
  padding: 0.5rem 0.5rem 0.5rem 1rem;
  display: flex;
  align-items: center;
  color: var(--text-secondary);
}

input[type="file"]::file-selector-button {
  background: rgba(76, 175, 80, 0.15);
  border: 1px solid rgba(76, 175, 80, 0.3);
  color: var(--primary-light);
  padding: 0.4rem 1.2rem;
  border-radius: 6px;
  margin-right: 1rem;
  cursor: pointer;
  font-weight: 600;
  font-family: inherit;
  font-size: 0.9rem;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

input[type="file"]::file-selector-button:hover {
  background: rgba(76, 175, 80, 0.25);
  border-color: rgba(76, 175, 80, 0.5);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(76, 175, 80, 0.15);
}

.btn-primary {
  background: var(--primary-color);
  color: white;
  border: none;
  border-radius: 8px;
  padding: 1rem 2rem;
  font-size: 1.1rem;
  font-weight: 600;
  cursor: pointer;
  width: 100%;
  transition: all 0.2s ease;
  margin-top: 1rem;
  text-decoration: none;
  display: inline-block;
  text-align: center;
}

.btn-primary:hover {
  background: var(--primary-light);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(76, 175, 80, 0.4);
}

.btn-primary:active {
  transform: translateY(0);
}

/* Grid Layout for Form */
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

@media (max-width: 768px) {
  .form-grid {
    grid-template-columns: 1fr;
  }
  
  .hero h1 {
    font-size: 2.5rem;
  }
}

.alert {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.9);
    width: 90%;
    max-width: 450px;
    padding: 2rem;
    border-radius: 16px;
    font-weight: 600;
    text-align: center;
    z-index: 9999;
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.6), 0 0 20px rgba(0,0,0,0.2);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    animation: fancyModalPop 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) forwards, modalFadeOut 0.5s ease 4.5s forwards;
}

.alert::before {
    content: '';
    position: fixed;
    top: -50vh; left: -50vw; right: -50vw; bottom: -50vh;
    background: rgba(0,0,0,0.5);
    z-index: -1;
}

@keyframes fancyModalPop {
    0% { transform: translate(-50%, -50%) scale(0.85); opacity: 0; }
    100% { transform: translate(-50%, -50%) scale(1); opacity: 1; }
}

@keyframes modalFadeOut {
    0% { opacity: 1; transform: translate(-50%, -50%) scale(1); visibility: visible; }
    100% { opacity: 0; transform: translate(-50%, -50%) scale(0.9); visibility: hidden; pointer-events: none; }
}

.alert-error {
    background: rgba(40, 15, 20, 0.85);
    color: #ff5252;
    border: 1px solid rgba(255, 82, 82, 0.4);
    border-top: 4px solid #ff5252;
}
.alert-success {
    background: rgba(15, 40, 20, 0.85);
    color: #4CAF50;
    border: 1px solid rgba(76, 175, 80, 0.4);
    border-top: 4px solid #4CAF50;
}

/* ==========================================================================
   Responsive Stepper Navigation
   ========================================================================== */
.stepper {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2.2rem;
  padding-bottom: 1.2rem;
  border-bottom: 1px solid var(--border-dark);
  gap: 0.5rem;
}

.step-item {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  color: var(--text-secondary);
  font-weight: 600;
  font-size: 0.9rem;
}

.step-num {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border-dark);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-secondary);
  transition: all 0.3s ease;
  flex-shrink: 0;
}

.step-item.active .step-num {
  background: var(--primary-light);
  color: #fff;
  border-color: var(--primary-light);
  box-shadow: 0 0 12px rgba(76, 175, 80, 0.5);
}

.step-item.active .step-text {
  color: #fff;
  font-weight: 700;
}

.step-item.completed .step-num {
  background: rgba(76, 175, 80, 0.2);
  color: var(--primary-light);
  border-color: var(--primary-light);
}

@media (max-width: 640px) {
  .stepper {
    padding-bottom: 1rem;
    margin-bottom: 1.5rem;
  }
  .step-text {
    display: none;
  }
  .step-item.active .step-text {
    display: inline-block;
    font-size: 0.8rem;
  }
}

/* ==========================================================================
   Modern Dropzone & File Upload Component
   ========================================================================== */
.upload-card {
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid var(--border-dark);
  border-radius: 12px;
  padding: 1.25rem;
  transition: all 0.25s ease;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.upload-card:hover {
  border-color: rgba(76, 175, 80, 0.4);
  background: rgba(0, 0, 0, 0.35);
}

.upload-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.upload-title {
  font-weight: 600;
  font-size: 0.95rem;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.req-badge {
  font-size: 0.7rem;
  padding: 0.2rem 0.55rem;
  border-radius: 20px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.req-badge.required {
  background: rgba(239, 68, 68, 0.2) !important;
  color: #ff4d4d !important;
  border: 1px solid rgba(239, 68, 68, 0.5) !important;
  font-weight: 800 !important;
}

.req-badge.optional {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-secondary);
  border: 1px solid var(--border-dark);
}

.file-help {
  font-size: 0.83rem;
  color: var(--text-secondary);
  margin-top: 0.35rem;
  line-height: 1.4;
}

.format-red {
  color: #4ade80 !important;
  font-weight: 800 !important;
  background: rgba(239, 68, 68, 0.22) !important;
  padding: 0.2rem 0.55rem;
  border-radius: 5px;
  border: 1px solid rgba(239, 68, 68, 0.45) !important;
  display: block;
  width: fit-content;
  max-width: 100%;
  margin-top: 0.35rem;
  letter-spacing: 0.01em;
  white-space: normal !important;
  word-break: break-word !important;
}

.dropzone-box {
  border: 2px dashed var(--border-dark);
  border-radius: 10px;
  padding: 1.25rem 1rem;
  text-align: center;
  cursor: pointer;
  background: rgba(255, 255, 255, 0.02);
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
}

.dropzone-box:hover, .dropzone-box.dragover {
  border-color: var(--primary-light);
  background: rgba(76, 175, 80, 0.08);
  transform: translateY(-1px);
}

.dropzone-box input[type="file"] {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
  z-index: 5;
}

.dropzone-content {
  pointer-events: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.4rem;
}

.dropzone-icon {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: rgba(76, 175, 80, 0.12);
  color: var(--primary-light);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 0.25rem;
}

.dropzone-text {
  font-size: 0.9rem;
  color: var(--text-primary);
  font-weight: 500;
}

.dropzone-text strong {
  color: var(--primary-light);
}

.dropzone-subtext {
  font-size: 0.78rem;
  color: var(--text-secondary);
}

.format-tags {
  display: flex;
  gap: 0.35rem;
  justify-content: center;
  flex-wrap: wrap;
  margin-top: 0.25rem;
}

.tag-pill {
  font-size: 0.7rem;
  background: rgba(255, 255, 255, 0.06);
  padding: 0.15rem 0.45rem;
  border-radius: 4px;
  color: var(--text-secondary);
  border: 1px solid rgba(255, 255, 255, 0.05);
}

/* Previews Grid & File Cards */
.file-list-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.75rem;
  margin-top: 0.6rem;
  width: 100%;
}

.form-group[style*="grid-column: 1 / -1"] .file-list-grid,
.form-group[style*="grid-column: 1/-1"] .file-list-grid {
  grid-template-columns: repeat(6, 1fr);
}

@media (max-width: 1200px) {
  .file-list-grid {
    grid-template-columns: repeat(3, 1fr);
  }
  .form-group[style*="grid-column: 1 / -1"] .file-list-grid,
  .form-group[style*="grid-column: 1/-1"] .file-list-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

@media (max-width: 992px) {
  .file-list-grid {
    grid-template-columns: repeat(3, 1fr);
  }
  .form-group[style*="grid-column: 1 / -1"] .file-list-grid,
  .form-group[style*="grid-column: 1/-1"] .file-list-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 768px) {
  .file-list-grid,
  .form-group[style*="grid-column: 1 / -1"] .file-list-grid,
  .form-group[style*="grid-column: 1/-1"] .file-list-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 480px) {
  .file-list-grid,
  .form-group[style*="grid-column: 1 / -1"] .file-list-grid,
  .form-group[style*="grid-column: 1/-1"] .file-list-grid {
    grid-template-columns: 1fr;
  }
}

.file-preview-card {
  background: rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 12px;
  padding: 0.75rem 0.5rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  gap: 0.4rem;
  width: 100%;
  box-sizing: border-box;
  min-height: 118px;
  position: relative;
  box-shadow: 0 4px 12px rgba(0,0,0,0.2);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  animation: fadeInScale 0.3s ease-out forwards;
  min-width: 0;
}

.file-preview-card:hover {
  border-color: rgba(76, 175, 80, 0.5);
  background: rgba(255, 255, 255, 0.1);
  transform: translateY(-3px);
  box-shadow: 0 8px 20px rgba(0,0,0,0.3), 0 0 12px rgba(76, 175, 80, 0.2);
}

.file-preview-info {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.3rem;
  width: 100%;
}

.file-action-top {
  display: contents; /* Container acts as a pass-through so children position directly relative to card */
}

.btn-view-file {
  position: absolute;
  top: 8px;
  left: 8px;
  z-index: 6;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: rgba(59, 130, 246, 0.18);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(96, 165, 250, 0.45);
  color: #60a5fa;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  text-decoration: none;
  transition: all 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.25);
  line-height: 1;
}

.btn-view-file:hover {
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.9), rgba(59, 130, 246, 0.95));
  color: #ffffff;
  border-color: #93c5fd;
  transform: translateY(-2px) scale(1.15);
  box-shadow: 0 6px 18px rgba(37, 99, 235, 0.5), 0 0 14px rgba(96, 165, 250, 0.6);
}

.btn-remove-file {
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 6;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: rgba(239, 68, 68, 0.18);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(248, 113, 113, 0.45);
  color: #f87171;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  transition: all 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.25);
  line-height: 1;
}

.btn-remove-file:hover {
  background: linear-gradient(135deg, rgba(220, 38, 38, 0.9), rgba(239, 68, 68, 0.95));
  color: #ffffff;
  border-color: #fca5a5;
  transform: translateY(-2px) scale(1.15);
  box-shadow: 0 6px 18px rgba(220, 38, 38, 0.5), 0 0 14px rgba(248, 113, 113, 0.6);
}

.file-size-tag {
  font-size: 0.68rem;
  font-weight: 700;
  color: var(--text-secondary);
  background: rgba(255, 255, 255, 0.08);
  padding: 0.15rem 0.35rem;
  border-radius: 4px;
  max-width: 100%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-align: center;
  margin: 0 auto;
}
}

.file-list-grid:empty {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.25rem;
  background: rgba(255, 255, 255, 0.02);
  border: 1px dashed rgba(255, 255, 255, 0.15);
  border-radius: 10px;
  color: rgba(255, 255, 255, 0.4);
  font-size: 0.85rem;
  font-style: italic;
  min-height: 70px;
  grid-column: 1 / -1;
}

.file-list-grid:empty::after {
  content: "No files selected for preview";
}



/* Uploaded Server Files Chips */
.server-files-container {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.5rem;
}

.uploaded-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: rgba(76, 175, 80, 0.12);
  border: 1px solid rgba(76, 175, 80, 0.3);
  color: #81c784;
  padding: 0.35rem 0.75rem;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.2s ease;
}

.uploaded-chip:hover {
  background: rgba(76, 175, 80, 0.22);
  border-color: var(--primary-light);
  color: #a5d6a7;
  transform: translateY(-1px);
}

/* Toast Notification - Upgraded to Fancy Modal */
.toast-alert {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.9);
  background: rgba(40, 15, 20, 0.85);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 82, 82, 0.4);
  border-top: 4px solid #ff5252;
  color: #ff5252;
  padding: 2rem;
  width: 90%;
  max-width: 450px;
  border-radius: 16px;
  box-shadow: 0 15px 40px rgba(0, 0, 0, 0.6), 0 0 20px rgba(0,0,0,0.2);
  z-index: 10000;
  font-weight: 600;
  font-size: 1.1rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 1rem;
  animation: fancyModalPop 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

.toast-alert::before {
  content: '';
  position: fixed;
  top: -50vh; left: -50vw; right: -50vw; bottom: -50vh;
  background: rgba(0,0,0,0.5);
  z-index: -1;
  pointer-events: none;
}

.toast-alert svg {
  width: 48px;
  height: 48px;
  stroke-width: 1.5;
  margin-bottom: 0.5rem;
}

/* ==========================================================================
   Stage 3 Aligned 2-Column Form Layout & Dropzones
   ========================================================================== */
.field-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.85rem;
  gap: 0.5rem;
}

.field-header label {
  font-weight: 700;
  font-size: 0.95rem;
  color: #ffffff;
  margin-bottom: 0;
  line-height: 1.35;
  letter-spacing: 0.02em;
  text-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

.dropzone-box {
  border: 2px dashed rgba(255, 255, 255, 0.2);
  border-radius: 12px;
  padding: 1.5rem 1rem;
  text-align: center;
  cursor: pointer;
  background: rgba(255, 255, 255, 0.03);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
}

.dropzone-box::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background: radial-gradient(circle at center, rgba(76, 175, 80, 0.15) 0%, transparent 70%);
  opacity: 0;
  transition: opacity 0.4s ease;
  z-index: 1;
}

.dropzone-box:hover::before, .dropzone-box.dragover::before {
  opacity: 1;
}

.dropzone-box:hover, .dropzone-box.dragover {
  border-color: var(--primary-light);
  background: rgba(76, 175, 80, 0.06);
  transform: translateY(-3px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2), 0 0 15px rgba(76, 175, 80, 0.15);
}

.dropzone-box input[type="file"] {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
  z-index: 10;
}

.dropzone-content {
  pointer-events: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.4rem;
  position: relative;
  z-index: 2;
}

.dropzone-icon {
  font-size: 1.5rem;
  color: var(--primary-light);
  margin-bottom: 0.2rem;
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  background: rgba(76, 175, 80, 0.15);
  width: 48px;
  height: 48px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 0 0 rgba(76, 175, 80, 0.4);
}

.dropzone-box:hover .dropzone-icon, .dropzone-box.dragover .dropzone-icon {
  transform: scale(1.15) translateY(-2px);
  background: rgba(76, 175, 80, 0.25);
  box-shadow: 0 0 0 6px rgba(76, 175, 80, 0.1);
}

.dropzone-text {
  font-size: 0.92rem;
  color: var(--text-primary);
  font-weight: 500;
}

.dropzone-text strong {
  color: var(--primary-light);
}

.dropzone-subtext {
  font-size: 0.78rem;
  color: var(--text-secondary);
}

.file-help {
  margin-top: 0.5rem;
}

/* ==========================================================================
   Comprehensive Responsive Breakpoints & Mobile System
   ========================================================================== */

/* Progress Bar Stepper (Desktop & Mobile Touch Scroll) */
.progress-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2rem;
  border-bottom: 1px solid var(--border-dark);
  padding-bottom: 1rem;
  gap: 0.5rem;
}

.progress-step {
  color: var(--text-secondary);
  font-weight: 600;
  font-size: 0.9rem;
  transition: all 0.2s ease;
}

.progress-step.active {
  color: var(--primary-light);
}

@media (max-width: 640px) {
  .progress-bar {
    overflow-x: auto;
    white-space: nowrap;
    gap: 0.5rem;
    padding-bottom: 0.75rem;
    margin-bottom: 1.5rem;
    -webkit-overflow-scrolling: touch;
    justify-content: flex-start;
    scrollbar-width: none;
  }
  
  .progress-bar::-webkit-scrollbar {
    display: none;
  }

  .progress-step {
    font-size: 0.78rem;
    flex-shrink: 0;
    padding: 0.35rem 0.65rem;
    background: rgba(255, 255, 255, 0.04);
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.08);
  }

  .progress-step.active {
    background: rgba(76, 175, 80, 0.2);
    border-color: rgba(76, 175, 80, 0.5);
    color: #ffffff;
    font-weight: 700;
  }
}

/* Tablet & Smaller Laptops (<= 900px) */
@media (max-width: 900px) {
  .container {
    padding: 1.25rem;
  }
  
  main {
    padding: 1rem !important;
  }
  
  .glass-card {
    padding: 1.5rem;
  }
  
  .hero {
    padding: 2.5rem 0;
  }
  
  .hero h1 {
    font-size: 2.2rem;
  }

  .preview-doc-grid {
    grid-template-columns: 1fr !important;
  }
}

/* Mobile Phones (<= 600px) */
@media (max-width: 600px) {
  .container {
    padding: 0.65rem;
  }

  main {
    padding: 0.5rem !important;
  }

  .glass-card {
    padding: 1rem;
    border-radius: 12px;
  }

  .hero h1 {
    font-size: 1.75rem;
  }

  .hero p {
    font-size: 0.95rem;
  }

  .btn-primary {
    padding: 0.85rem 1.2rem;
    font-size: 1rem;
    width: 100% !important;
  }

  /* Header Logo & Title Mobile Optimization */
  div[style*="display: inline-flex"][style*="height: 60px"] img,
  div[style*="gap: 1rem"] > img[alt*="Logo"],
  div[style*="gap: 1rem"] > img[alt*="APC Logo"] {
    height: 44px !important;
  }

  h2 {
    font-size: 1.35rem !important;
  }

  /* Form & Input Adjustments for Mobile (Prevents iOS auto-zoom on <16px font) */
  .form-group label {
    font-size: 0.85rem;
  }

  .form-control, input[type="text"], input[type="email"], input[type="tel"], select, textarea {
    padding: 0.7rem 0.85rem;
    font-size: 16px !important;
  }

  /* Navigation Buttons Container Flex Wrap */
  div[style*="justify-content: space-between"][style*="flex-wrap: wrap"],
  div[style*="justify-content: flex-end"][style*="flex-wrap: wrap"] {
    flex-direction: column-reverse !important;
    align-items: stretch !important;
    gap: 0.75rem !important;
  }

  div[style*="justify-content: space-between"] > div,
  div[style*="justify-content: space-between"] > a,
  div[style*="justify-content: space-between"] > button,
  div[style*="justify-content: flex-end"] > a,
  div[style*="justify-content: flex-end"] > button {
    width: 100% !important;
  }

  .btn-primary, a.btn-primary, button.btn-primary {
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
    text-align: center !important;
    width: 100% !important;
  }

  /* Executive Officers Row on Step 2 Mobile */
  .exec-row {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 0.5rem !important;
  }

  .exec-row input {
    width: 100% !important;
    flex: 1 1 100% !important;
  }

  .remove-exec-btn {
    align-self: flex-end !important;
    width: auto !important;
    padding: 0.4rem 0.8rem !important;
  }

  /* Key-Value Preview Grid on Step 4 Mobile */
  .preview-kv-grid {
    grid-template-columns: 1fr !important;
    gap: 0.85rem !important;
  }

  .preview-section-card {
    padding: 1rem !important;
  }

  .preview-section-header {
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 0.5rem !important;
  }

  /* Table Responsive Scrolling */
  .table-responsive, section.glass-card, div[style*="overflow-x: auto"] {
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch !important;
  }

  /* Flex filter containers on admin views */
  section.glass-card[style*="display: flex"] {
    flex-direction: column !important;
    align-items: stretch !important;
  }

  section.glass-card[style*="display: flex"] > div {
    width: 100% !important;
    min-width: 100% !important;
  }

  /* In-modal document viewer & custom modals on mobile */
  #docPreviewCard {
    width: 98% !important;
    height: 92vh !important;
    margin: 0 auto !important;
    border-radius: 12px !important;
  }

  #customGlassModalCard {
    width: 95% !important;
    margin: 0 auto !important;
  }

  /* Extra Zero-Overflow Protection for Mobile */
  .container {
    padding-left: 0.75rem !important;
    padding-right: 0.75rem !important;
    max-width: 100% !important;
    overflow-x: hidden !important;
  }

  .glass-card {
    padding: 1.25rem 0.75rem !important;
    max-width: 100% !important;
    overflow-x: hidden !important;
  }

  .progress-bar {
    display: flex !important;
    flex-wrap: wrap !important;
    gap: 0.4rem 0.5rem !important;
    justify-content: center !important;
    max-width: 100% !important;
    overflow-x: hidden !important;
  }

  .progress-step {
    font-size: 0.75rem !important;
    padding: 0.25rem 0.5rem !important;
    border-radius: 12px !important;
    white-space: nowrap !important;
  }

  .id-badge {
    max-width: 100% !important;
    font-size: 1rem !important;
    word-break: break-all !important;
    white-space: normal !important;
    padding: 0.75rem !important;
  }

  .badge-pill, .badge-pill-blue, .badge-pill-purple, .tag-pill, .format-red {
    max-width: 100% !important;
    white-space: normal !important;
    word-break: break-word !important;
  }

  p, h1, h2, h3, h4, h5, h6, span, label {
    max-width: 100% !important;
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
  }
}

/* Small Mobile Phones (<= 400px) */
@media (max-width: 400px) {
  .hero h1 {
    font-size: 1.4rem;
  }

  .glass-card {
    padding: 0.8rem 0.5rem !important;
  }

  h2 {
    font-size: 1.25rem !important;
  }
}

/* ==========================================================================
   Standardized Mobile & Desktop Navigation Button System
   ========================================================================== */
.nav-actions-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 2.5rem;
  flex-wrap: wrap;
  gap: 1rem;
  width: 100%;
  box-sizing: border-box;
}

.nav-actions-group {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.nav-actions-group .btn-primary,
.nav-actions-group a.btn-primary,
.nav-actions-group button.btn-primary,
.nav-actions-container .btn-primary,
.nav-actions-container a.btn-primary,
.nav-actions-container button.btn-primary {
  width: auto;
  margin-top: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.8rem 1.5rem;
  font-size: 0.95rem;
  font-weight: 700;
  border-radius: 10px;
  box-sizing: border-box;
  text-decoration: none;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  min-height: 44px;
}

/* Button Variants */
.btn-nav-primary {
  background: var(--primary-color) !important;
  color: #ffffff !important;
  border: none !important;
  box-shadow: 0 4px 12px rgba(76, 175, 80, 0.3) !important;
}
.btn-nav-primary:hover {
  background: var(--primary-light) !important;
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(76, 175, 80, 0.45) !important;
}

.btn-nav-secondary {
  background: transparent !important;
  border: 1px solid var(--border-dark) !important;
  color: var(--text-secondary) !important;
}
.btn-nav-secondary:hover {
  background: rgba(255, 255, 255, 0.08) !important;
  color: #ffffff !important;
  border-color: rgba(255, 255, 255, 0.25) !important;
}

.btn-nav-danger {
  background: rgba(239, 68, 68, 0.15) !important;
  color: #f87171 !important;
  border: 1px solid rgba(239, 68, 68, 0.3) !important;
}
.btn-nav-danger:hover {
  background: rgba(239, 68, 68, 0.28) !important;
  color: #ffffff !important;
  border-color: rgba(239, 68, 68, 0.5) !important;
}

.btn-nav-warning {
  background: rgba(245, 158, 11, 0.15) !important;
  color: #fbbf24 !important;
  border: 1px solid rgba(245, 158, 11, 0.3) !important;
}
.btn-nav-warning:hover {
  background: rgba(245, 158, 11, 0.28) !important;
  color: #ffffff !important;
  border-color: rgba(245, 158, 11, 0.5) !important;
}

/* Tablet & Mobile Responsiveness (<= 768px) */
@media (max-width: 768px) {
  .aux-group,
  #exitBtn,
  #resetBtn,
  .btn-nav-danger,
  .btn-nav-warning {
    display: none !important;
  }

  .nav-actions-container,
  .nav-actions-container.has-dual-groups {
    display: flex !important;
    flex-direction: column !important;
    gap: 0.75rem !important;
    width: 100% !important;
    margin-top: 1.75rem !important;
  }

  .nav-actions-group {
    width: 100% !important;
    display: flex !important;
    flex-direction: column !important;
    gap: 0.75rem !important;
  }

  .btn-nav-primary {
    order: -1 !important;
  }

  .btn-nav-secondary {
    order: 1 !important;
  }

  .nav-actions-group .btn-primary,
  .nav-actions-group a.btn-primary,
  .nav-actions-group button.btn-primary,
  .nav-actions-container .btn-primary,
  .nav-actions-container a.btn-primary,
  .nav-actions-container button.btn-primary {
    width: 100% !important;
    max-width: 100% !important;
    justify-content: center !important;
    text-align: center !important;
    padding: 0.88rem 0.75rem !important;
    font-size: 0.9rem !important;
    border-radius: 12px !important;
    box-sizing: border-box !important;
  }
}

/* ==========================================================================
   Global Custom Scrollbar Styling (Emerald & Dark Glass Theme)
   ========================================================================== */

/* Firefox Scrollbars */
* {
  scrollbar-width: thin;
  scrollbar-color: rgba(76, 175, 80, 0.6) rgba(15, 25, 18, 0.5);
}

/* WebKit (Chrome, Safari, Edge) Scrollbars */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
  background: rgba(12, 18, 12, 0.4);
}

::-webkit-scrollbar-track {
  background: rgba(15, 25, 18, 0.4);
  border-radius: 10px;
}

::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, rgba(46, 125, 50, 0.75), rgba(76, 175, 80, 0.85));
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  transition: all 0.3s ease;
}

::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(180deg, #4CAF50, #81C784);
  box-shadow: 0 0 12px rgba(76, 175, 80, 0.6);
}

::-webkit-scrollbar-corner {
  background: rgba(12, 18, 12, 0.4);
}

/* ==========================================================================
   Table Card Dual Scrollbar & Vertical Side Scrollbar System
   ========================================================================== */

.table-top-scroll-container {
  overflow-x: auto;
  overflow-y: hidden;
  height: 12px;
  margin-bottom: 8px;
  border-radius: 8px;
  background: rgba(15, 23, 42, 0.4);
  border: 1px solid rgba(76, 175, 80, 0.15);
  scrollbar-width: thin;
  scrollbar-color: rgba(76, 175, 80, 0.6) rgba(15, 23, 42, 0.4);
}

.table-top-scroll-container::-webkit-scrollbar {
  height: 8px;
  background: rgba(15, 23, 42, 0.4);
  border-radius: 6px;
}

.table-top-scroll-container::-webkit-scrollbar-thumb {
  background: linear-gradient(90deg, rgba(27, 94, 32, 0.8), rgba(76, 175, 80, 0.9));
  border-radius: 6px;
  border: 1px solid rgba(76, 175, 80, 0.3);
}

.table-top-scroll-container::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(90deg, #4CAF50, #81C784);
  box-shadow: 0 0 10px rgba(76, 175, 80, 0.6);
}

.table-responsive-container {
  max-height: 580px;
  overflow-x: auto;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  scrollbar-color: rgba(76, 175, 80, 0.6) rgba(15, 23, 42, 0.4);
  border-radius: 12px;
  border: 1px solid rgba(76, 175, 80, 0.15);
  position: relative;
}

.table-responsive-container::-webkit-scrollbar {
  width: 8px; /* Side vertical scrollbar */
  height: 8px; /* Bottom horizontal scrollbar */
  background: rgba(15, 23, 42, 0.4);
  border-radius: 6px;
}

.table-responsive-container::-webkit-scrollbar-thumb {
  background: linear-gradient(135deg, rgba(27, 94, 32, 0.8), rgba(76, 175, 80, 0.9));
  border-radius: 6px;
  border: 1px solid rgba(76, 175, 80, 0.2);
}

.table-responsive-container::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(135deg, #4CAF50, #81C784);
  box-shadow: 0 0 12px rgba(76, 175, 80, 0.6);
}

.table-responsive-container table thead {
  position: sticky;
  top: 0;
  z-index: 10;
  background: #0f190f !important;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
}

.table-responsive-container table thead tr {
  background: #0f190f !important;
}



