/**
 * Shared layout for authenticated app pages (sidebar + main).
 * Use .app-main on <main> — full width, no narrow column with empty right gutter.
 */

.app-shell {
  background: #f3f4f5;
  overflow-x: hidden;
  max-width: 100%;
}

.app-sidebar-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 55;
  background: rgba(4, 19, 41, 0.42);
}

body.app-sidebar-open {
  overflow: hidden;
}

body.app-sidebar-open .app-sidebar-backdrop {
  display: block;
}

@media (max-width: 767px) {
  .app-sidebar-open-btn {
    position: fixed;
    top: 4.6rem;
    left: 0.85rem;
    z-index: 45;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.45rem 0.75rem;
    border-radius: 0.65rem;
    border: 1px solid rgba(4, 19, 41, 0.12);
    background: #fff;
    color: #041329;
    font-size: 0.8rem;
    font-weight: 700;
    box-shadow: 0 8px 20px rgba(4, 19, 41, 0.08);
  }

  aside.app-sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    z-index: 60;
    width: min(18rem, 86vw);
    transform: translateX(-105%);
    transition: transform 0.2s ease;
    display: flex !important;
    background: #fff;
    border-right: 1px solid #edeeef;
    padding: 1rem;
    gap: 0.25rem;
  }

  body.app-sidebar-open aside.app-sidebar {
    transform: translateX(0);
  }

  .app-sidebar-close {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.25rem;
    height: 2.25rem;
    border-radius: 0.65rem;
    border: 1px solid #e7e8e9;
    background: #fff;
    color: #041329;
    margin-left: auto;
  }

  .app-main {
    padding-top: 3.25rem !important;
  }
}

@media (min-width: 768px) {
  .app-sidebar-open-btn,
  .app-sidebar-close {
    display: none !important;
  }
}

.app-main {
  flex: 1;
  width: 100%;
  min-width: 0;
  max-width: none;
}

.app-main .section-card,
.app-main .step-content-v2 {
  width: 100%;
}

/* AI import: review basic fields use horizontal space */
.ai-import-v2 .ai-fields-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
}

@media (min-width: 640px) {
  .ai-import-v2 .ai-fields-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .ai-import-v2 .ai-fields-grid > .md\:col-span-2 {
    grid-column: span 2;
  }
}

@media (min-width: 1200px) {
  .ai-import-v2 .ai-fields-grid {
    grid-template-columns: repeat(4, 1fr);
  }

  .ai-import-v2 .ai-fields-grid > .md\:col-span-2 {
    grid-column: span 2;
  }
}

.ai-import-v2 .ai-fields-grid > .ai-field-full {
  grid-column: 1 / -1;
}

.ai-import-v2 .ai-processing-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
  max-width: 56rem;
  margin: 0 auto;
  width: 100%;
}

@media (min-width: 768px) {
  .ai-import-v2 .ai-processing-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (min-width: 1024px) {
  .ai-import-v2 .review-nav-bar {
    display: flex;
    gap: 0.5rem;
    width: 100%;
    padding: 0.25rem;
    border-radius: 1rem;
    background: #fff;
    border: 1px solid #edeeef;
  }

  .ai-import-v2 .review-nav-bar .review-nav-btn {
    flex: 1;
    justify-content: center;
    text-align: center;
  }
}

@media (min-width: 1280px) {
  #ai-experience-list-v2 {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
    align-items: start;
  }

  #ai-experience-list-v2 .exp-card-v2 {
    height: 100%;
  }
}

.ai-import-v2 .ai-upload-tips {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.75rem;
}

@media (min-width: 640px) {
  .ai-import-v2 .ai-upload-tips {
    grid-template-columns: repeat(3, 1fr);
  }
}

.ai-import-v2 .ai-summary-bar {
  width: 100%;
}

.ai-import-v2 #drop-zone-v2 {
  width: 100%;
  max-width: none;
}
