body,
html {
  height: 100%;
}

#wrapper {
  min-height: 100vh;
  display: flex;
  flex-direction: row;
}

#page-content-wrapper {
  flex-grow: 1;
  width: 100%;
  margin-left: 250px;
  overflow: auto;
}

#sidebar-wrapper {
    width: 250px; 
  height: 100vh;
  /* overflow-y: auto; */
  position: fixed; /* Fixed position */

}

#sidebar-wrapper.collapsed {
  width: 80px !important;
  z-index: 1050;
}

#page-content-wrapper.expanded {
  margin-left: 80px; /* Ensure this matches the collapsed sidebar width */
}

/* Adjust the size of the icons and the display of text in collapsed mode */
#sidebar-wrapper.collapsed .nav-link span,
#sidebar-wrapper.collapsed .sidebar-heading h2 {
  display: none;
}

#sidebar-wrapper.collapsed .bi-list {
  display: inline-block;
}

/* Sidebar styling */
#sidebar-wrapper {
  transition: width 0.3s ease;
}

#page-content-wrapper {
  transition: margin-left 0.3s ease;
}

.table-container {
  overflow: visible;
}

#sidebar-wrapper.collapsed ul li a span,
#sidebar-wrapper.collapsed ul li a i {
  display: none;
  /* Hide text labels */
}

#sidebar-wrapper.collapsed ul li a i {
  display: inline-block;
  /* Ensure icons are shown */
}

#sidebar-wrapper ul li ul li a {
  background-color: #4b4f54;
  /* Slightly lighter than the main sidebar color */
}

#sidebar-wrapper ul li a:hover,

#sidebar-wrapper ul li ul li a:hover {
  background-color: #1c1e22;
  /* A bit lighter for hover effect */
}

#sidebar-wrapper.collapsed ul {
  list-style-type: none;
  /* Remove bullets */
  padding-left: 0;
  /* Remove padding that may offset icons to the right */
}

#sidebar-wrapper ul {
  list-style-type: none;
  /* Consistently remove bullets */
  padding-left: 0;
  /* Consistently remove padding */
}


.nav-link i,
.dropdown-toggle i {
    font-size: 16px; /* Standard icon size */
}


.nav-link {
    color: whitesmoke;
}


.table-container {
    overflow: visible; 
  }

/* Ensure Bootstrap modals stay above backdrop and custom menus */
.modal {
  z-index: 2000 !important;
}

.modal-backdrop {
  z-index: 1990 !important;
}

.modal-dialog {
  pointer-events: auto;
}

.custom-select2+.select2-container {
    min-width: 180px;
}

.word-wrap {
    word-wrap: break-word;
    max-width: 600px;
}

.select2-container {
  width: 100% !important;
  min-width: 250px !important;
  max-width: 600;
}

.select2-selection--multiple {
  min-height: 38px;
  border: 1px solid #ced4da;
  border-radius: 0.375rem;
}

.select2-selection__rendered {
  display: flex;
  flex-wrap: wrap;
  overflow: hidden;
  white-space: normal;
  max-width: 100%;
  position: relative;
}

.select2-selection__choice {
  margin-top: 0.2rem;
  margin-right: 0.2rem;
  font-size: 0.875rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
  flex: 0 1 auto;
}

td .select2-container {
  min-width: 350px !important;
  max-width:600px;
  width: 100% !important;
  display: inline-block;
}


.select2-search__field {
  width: auto !important;
  min-width: 1em !important;
  max-width: 300px !important;
  flex-grow: 1;
  flex-shrink: 1;
}

.select2-selection__choice.hidden-choice {
  display: none;
}

.select2-selection__choice.more-indicator {
  display: inline-block;
  background-color: #e2e6ea;
  color: #333;
  font-size: 0.85em;
  padding: 2px 6px;
  border-radius: 4px;
  margin-left: 4px;
}

.select2-selection__rendered {
  flex-wrap: nowrap;
  overflow-x: auto;
  scrollbar-width: thin;
  max-width: 100%;
}

.select2-selection--multiple {
  max-width: 100%;
  overflow-x: auto;
}

.select2-selection__choice {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Instruction generator dropzone */
.dropzone {
  border: 2px dashed #cbd5e1;
  border-radius: 16px;
  padding: 24px;
  cursor: pointer;
  background: #f8fafc;
  transition: border-color 0.2s ease, background-color 0.2s ease;
  position: relative;
}

.dropzone-link {
  position: relative;
  z-index: 2;
}

.dropzone.is-dragover {
  border-color: #4f46e5;
  background: #eef2ff;
}

.dropzone-body {
  text-align: center;
}

.dropzone-icon {
  font-size: 28px;
  margin-bottom: 8px;
}

.dropzone-title {
  font-weight: 600;
  color: #0f172a;
}

.dropzone-subtitle {
  color: #475569;
  margin-top: 4px;
}

.dropzone-link {
  color: #4f46e5;
  text-decoration: underline;
}

.dropzone-meta {
  font-size: 0.85rem;
  margin-top: 6px;
}

.file-preview {
  min-height: 32px;
}

.file-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: #f1f5f9;
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 0.85rem;
  color: #0f172a;
}

.file-chip-size {
  color: #64748b;
}

.file-input-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  border: 0;
}

/* Instructions refresh */
.instructions-shell {
  font-family: "IBM Plex Sans", "Segoe UI", sans-serif;
  color: #0f172a;
}

.instructions-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  background: linear-gradient(120deg, #fef3c7 0%, #fef9c3 40%, #e0f2fe 100%);
  border-radius: 20px;
  padding: 28px 32px;
  box-shadow: 0 20px 40px rgba(15, 23, 42, 0.08);
  margin: 24px 0;
}

.instructions-kicker {
  text-transform: uppercase;
  letter-spacing: 0.2em;
  font-size: 0.7rem;
  font-weight: 600;
  color: #a16207;
}

.instructions-title {
  font-family: "Space Grotesk", "IBM Plex Sans", sans-serif;
  font-size: 2rem;
  margin: 6px 0 4px;
}

.instructions-subtitle {
  margin: 0;
  color: #475569;
  max-width: 520px;
}

.instructions-cta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-end;
}

.instructions-panel {
  background: #ffffff;
  border-radius: 16px;
  padding: 20px 24px;
  border: 1px solid #e2e8f0;
  box-shadow: 0 10px 20px rgba(15, 23, 42, 0.04);
}

.instructions-panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.panel-title {
  font-weight: 600;
}

.panel-hint {
  font-size: 0.85rem;
  color: #64748b;
}

.instructions-table-card {
  margin-top: 24px;
  background: #ffffff;
  border-radius: 16px;
  border: 1px solid #e2e8f0;
  padding: 12px;
  box-shadow: 0 16px 30px rgba(15, 23, 42, 0.06);
}

.instruction-table thead th {
  background: #f8fafc;
  border-bottom: 1px solid #e2e8f0;
  font-weight: 600;
  color: #475569;
}

.instruction-table tbody tr:hover {
  background: #f8fafc;
}

.instruction-table .badge {
  border-radius: 999px;
  padding: 4px 10px;
  font-weight: 500;
}

.instruction-name-card {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.instruction-name {
  font-weight: 600;
  font-size: 1rem;
}

.instruction-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}

.badge-pill {
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 0.75rem;
  font-weight: 600;
}

.badge-outline {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  color: #475569;
}

.badge-success {
  background: #dcfce7;
  color: #15803d;
  border: 1px solid #bbf7d0;
}

.badge-warning {
  background: #fef3c7;
  color: #b45309;
  border: 1px solid #fde68a;
}

.badge-muted {
  background: #f1f5f9;
  color: #475569;
  border: 1px solid #e2e8f0;
}

.composition-stack {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 0.85rem;
  color: #475569;
}

.composition-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.composition-icon {
  font-size: 1rem;
}

.composition-value {
  margin-left: auto;
  font-weight: 600;
  color: #0f172a;
}

.tag-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.badge-tag {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  color: #0f172a;
}

.badge-theme {
  background: #e0f2fe;
  border-color: #bae6fd;
  color: #0369a1;
}

.badge-sentiment {
  background: #fce7f3;
  border-color: #fbcfe8;
  color: #9d174d;
}

.badge-author {
  background: #ede9fe;
  border-color: #ddd6fe;
  color: #5b21b6;
}

@media (max-width: 992px) {
  .instructions-hero {
    flex-direction: column;
    align-items: flex-start;
  }

  .instructions-cta {
    justify-content: flex-start;
  }
}

/* Settings refresh */
.settings-shell {
  font-family: "IBM Plex Sans", "Segoe UI", sans-serif;
  color: #0f172a;
}

.settings-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  background: linear-gradient(120deg, #e0f2fe 0%, #fef3c7 55%, #fee2e2 100%);
  border-radius: 20px;
  padding: 28px 32px;
  box-shadow: 0 20px 40px rgba(15, 23, 42, 0.08);
  margin: 24px 0;
}

.settings-kicker {
  text-transform: uppercase;
  letter-spacing: 0.2em;
  font-size: 0.7rem;
  font-weight: 600;
  color: #0ea5e9;
}

.settings-title {
  font-family: "Space Grotesk", "IBM Plex Sans", sans-serif;
  font-size: 2rem;
  margin: 6px 0 4px;
}

.settings-subtitle {
  margin: 0;
  color: #475569;
  max-width: 520px;
}

.settings-card {
  background: #ffffff;
  border-radius: 18px;
  border: 1px solid #e2e8f0;
  padding: 20px;
  box-shadow: 0 18px 35px rgba(15, 23, 42, 0.06);
  display: flex;
  flex-direction: column;
  gap: 16px;
  height: 100%;
}

.settings-card-body {
  display: flex;
  gap: 14px;
  align-items: flex-start;
}

.settings-card-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
}

.settings-card-content h5 {
  margin: 0 0 4px;
  font-weight: 600;
}

.settings-card-content p {
  margin: 0;
  color: #64748b;
  font-size: 0.9rem;
}

/* Sessions refresh */
.sessions-shell {
  font-family: "IBM Plex Sans", "Segoe UI", sans-serif;
  color: #0f172a;
}

.sessions-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  background: linear-gradient(120deg, #f1f5f9 0%, #dbeafe 45%, #e0f2fe 100%);
  border-radius: 20px;
  padding: 28px 32px;
  box-shadow: 0 20px 40px rgba(15, 23, 42, 0.08);
  margin: 24px 0;
}

.sessions-kicker {
  text-transform: uppercase;
  letter-spacing: 0.2em;
  font-size: 0.7rem;
  font-weight: 600;
  color: #2563eb;
}

.sessions-title {
  font-family: "Space Grotesk", "IBM Plex Sans", sans-serif;
  font-size: 2rem;
  margin: 6px 0 4px;
}

.sessions-subtitle {
  margin: 0;
  color: #475569;
  max-width: 520px;
}

.sessions-cta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-end;
}

.sessions-panel {
  background: #ffffff;
  border-radius: 16px;
  padding: 20px 24px;
  border: 1px solid #e2e8f0;
  box-shadow: 0 10px 20px rgba(15, 23, 42, 0.04);
}

.sessions-panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.sessions-table-card {
  margin-top: 24px;
  background: #ffffff;
  border-radius: 16px;
  border: 1px solid #e2e8f0;
  padding: 12px;
  box-shadow: 0 16px 30px rgba(15, 23, 42, 0.06);
}

.sessions-table {
  border-radius: 12px;
  overflow: hidden;
}

@media (max-width: 992px) {
  .settings-hero,
  .sessions-hero {
    flex-direction: column;
    align-items: flex-start;
  }

  .sessions-cta {
    justify-content: flex-start;
  }
}

/* Shared section layout for refreshed pages */
.section-shell {
  font-family: "IBM Plex Sans", "Segoe UI", sans-serif;
  color: #0f172a;
}

.section-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  background: linear-gradient(120deg, #f8fafc 0%, #e0f2fe 50%, #e2e8f0 100%);
  border-radius: 20px;
  padding: 28px 32px;
  box-shadow: 0 20px 40px rgba(15, 23, 42, 0.08);
  margin: 24px 0;
}

.section-kicker {
  text-transform: uppercase;
  letter-spacing: 0.2em;
  font-size: 0.7rem;
  font-weight: 600;
  color: #2563eb;
}

.section-title {
  font-family: "Space Grotesk", "IBM Plex Sans", sans-serif;
  font-size: 2rem;
  margin: 6px 0 4px;
}

.section-subtitle {
  margin: 0;
  color: #475569;
  max-width: 520px;
}

.section-cta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-end;
}

.panel-card {
  background: #ffffff;
  border-radius: 16px;
  padding: 20px 24px;
  border: 1px solid #e2e8f0;
  box-shadow: 0 10px 20px rgba(15, 23, 42, 0.04);
}

.table-card {
  margin-top: 24px;
  background: #ffffff;
  border-radius: 16px;
  border: 1px solid #e2e8f0;
  padding: 12px;
  box-shadow: 0 16px 30px rgba(15, 23, 42, 0.06);
}

.form-card {
  background: #ffffff;
  border-radius: 18px;
  border: 1px solid #e2e8f0;
  padding: 24px;
  box-shadow: 0 16px 30px rgba(15, 23, 42, 0.06);
}

.form-card .form-label {
  font-weight: 600;
  color: #0f172a;
}

.form-card .form-text {
  color: #64748b;
}

.form-control,
.form-select,
.form-check-input,
.select2-selection {
  border-radius: 12px;
  border-color: #e2e8f0;
  box-shadow: none;
}

.form-control:focus,
.form-select:focus,
.form-check-input:focus {
  border-color: #93c5fd;
  box-shadow: 0 0 0 0.2rem rgba(147, 197, 253, 0.25);
}

.modal-content {
  border-radius: 18px;
  border: 1px solid #e2e8f0;
  box-shadow: 0 24px 40px rgba(15, 23, 42, 0.12);
}

.modal-header {
  border-bottom: 1px solid #e2e8f0;
}

.modal-footer {
  border-top: 1px solid #e2e8f0;
}

.progress {
  height: 12px;
  border-radius: 999px;
  overflow: hidden;
  background: #e2e8f0;
}

.progress-bar {
  background: linear-gradient(90deg, #3b82f6 0%, #6366f1 100%);
}

/* Wizard layout */
.wizard-shell {
  font-family: "IBM Plex Sans", "Segoe UI", sans-serif;
  color: #0f172a;
}

.wizard-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  background: linear-gradient(120deg, #f8fafc 0%, #e2e8f0 45%, #e0f2fe 100%);
  border-radius: 20px;
  padding: 24px 32px;
  box-shadow: 0 18px 36px rgba(15, 23, 42, 0.08);
  margin: 24px 0;
}

.wizard-kicker {
  text-transform: uppercase;
  letter-spacing: 0.2em;
  font-size: 0.7rem;
  font-weight: 600;
  color: #2563eb;
}

.wizard-title {
  font-family: "Space Grotesk", "IBM Plex Sans", sans-serif;
  font-size: 1.9rem;
  margin: 6px 0 4px;
}

.wizard-subtitle {
  margin: 0;
  color: #475569;
  max-width: 560px;
}

.wizard-steps {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin: 20px 0;
}

.wizard-step {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid #e2e8f0;
  background: #ffffff;
  font-size: 0.8rem;
  color: #475569;
}

.wizard-step.is-active {
  background: #dbeafe;
  border-color: #bfdbfe;
  color: #1d4ed8;
  font-weight: 600;
}

.wizard-step.is-done {
  background: #dcfce7;
  border-color: #bbf7d0;
  color: #15803d;
}

.tag-preview {
  margin-top: 10px;
}

.tag-preview .tag {
  display: inline-block;
  background: #f1f5f9;
  border-radius: 999px;
  padding: 4px 10px;
  margin-right: 6px;
  margin-bottom: 6px;
  font-size: 0.85rem;
  color: #334155;
}

.wizard-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 24px;
  align-items: start;
}

.wizard-summary {
  position: sticky;
  top: 90px;
}

.summary-card {
  background: #ffffff;
  border-radius: 16px;
  border: 1px solid #e2e8f0;
  padding: 16px 18px;
  box-shadow: 0 12px 24px rgba(15, 23, 42, 0.08);
}

.summary-card h6 {
  font-weight: 600;
  margin-bottom: 12px;
}

.summary-item {
  display: flex;
  justify-content: space-between;
  font-size: 0.85rem;
  color: #475569;
  margin-bottom: 8px;
}

.summary-item strong {
  color: #0f172a;
}

@media (max-width: 992px) {
  .wizard-hero {
    flex-direction: column;
    align-items: flex-start;
  }

  .wizard-grid {
    grid-template-columns: 1fr;
  }

  .wizard-summary {
    position: static;
  }
}

@media (max-width: 992px) {
  .section-hero {
    flex-direction: column;
    align-items: flex-start;
  }

  .section-cta {
    justify-content: flex-start;
  }
}
