:root {
  /* Primary colors */
  --primary-color: #123684;  /* legartis-blue-default */
  --logo-width: 148px;
  --logo-height: 36px;
  --secondary-color: #4658ac; /* legartis-ml-blue */
  --background-color: #ffffff; /* White background */
  --text-color: #383838; /* extra-dark-grey */
  --border-color: #d6d6d6; /* light-grey */
  --accent-color: #123684; /* legartis-dark-blue */
  --white-accent: #ffffff;
  --error-color: #ab1717; /* legartis-red */
  --success-color: #238468; /* legartis-confirmation */
  
  /* Additional colors */
  --legartis-grey-default: #6a6a6a;
  --legartis-red-default: #8f0000;
  --legartis-green-default: #34b791;
  --legartis-orange-default: #de7135;
  --legartis-pink-default: #bf3159;
  --extra-light-grey: #e9e9eb;
  --light-grey: #d6d6d6;
  --medium-light-grey: #b2b2b2;
  --legartis-grey: #a2a6ac;
  --medium-dark-grey: #929292;
  --default-grey: #565656;
  --extra-dark-grey: #383838;
  --legartis-dark-yellow: #e1bc29;
  --legartis-dark-orange: #de6a35;
  --legartis-light-orange: #fe8f4d;
  --legartis-extra-light-grey-blue: #f2f6fa;
  --legartis-light-grey-blue: #b4ccf0;
  
  /* Shadows - Material Design elevation */
  --shadow-sm: 0 1px 3px 0 rgba(0, 0, 0, 0.12), 0 1px 2px 0 rgba(0, 0, 0, 0.14);
  --shadow: 0 2px 4px -1px rgba(0, 0, 0, 0.2), 0 4px 6px 0 rgba(0, 0, 0, 0.14);
  --shadow-md: 0 3px 6px -1px rgba(0, 0, 0, 0.2), 0 6px 12px 0 rgba(0, 0, 0, 0.14);
  
  /* Spacing - multiples of 6px */
  --space-1: 6px;
  --space-2: 12px;
  --space-3: 18px;
  --space-4: 24px;
  --space-5: 30px;
  --space-6: 36px;
  --space-8: 48px;
  --space-10: 60px;
  
  /* Typography */
  --font-family: 'Raleway', sans-serif;
  --font-size-tiny: 0.7rem;
  --font-size-small: 0.8125rem;
  --font-size-normal: 0.875rem;
  --font-size-medium: 1rem;
  --font-size-large: 1.25rem;
  --font-weight-normal: 400;
  --font-weight-medium: 500;
  --font-weight-bold: 700;
  --letter-spacing-tight: 0.015625rem;
  --letter-spacing-normal: 0.03125rem;
  --letter-spacing-wide: 0.0625rem;

  /* Sidebar specific */
  --sidebar-width: 350px; /* Increased from 300px */
  --top-bar-height: 50px; /* Calculated based on logo height and top-bar padding */
}

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

.top-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--space-1) var(--space-1); /* Adjust horizontal padding as needed */
  width: 100%;
  /* Optional: if you want a border at the bottom of the top bar */
  /* border-bottom: 1px solid var(--border-color); */
  /* Optional: if you want the top bar to be sticky (fixed) */
  /* position: fixed;
  top: 0;
  left: 0;
  background-color: var(--background-color);
  z-index: 1000;
  box-shadow: var(--shadow-sm); */
}

.logo-container {
  /* position: fixed; Removed */
  /* top: 18px; Removed */
  /* left: 18px; Removed */
  /* z-index: 10; Removed, z-index handled by top-bar if fixed */
  margin: 0px; /* Retain original margin if needed for internal spacing */
  padding: 0px; /* Retain original padding if needed for internal spacing */
  height: var(--logo-height);
  width: var(--logo-width);
}

.logo {
  height: var(--logo-height);
  width: var(--logo-width);
  margin: 0px;
  padding: 0px;
}

body {
  font-family: 'Raleway', sans-serif;
  line-height: 1.6;
  color: var(--text-color);
  background-color: var(--background-color);
  padding: var(--space-3) var(--space-6);
  margin: 0;
  height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Media queries for responsive design */
@media (max-width: 768px) {
  body {
    padding: var(--space-3);
  }
  
  .test-sets-table th, .test-sets-table td,
  .test-cases-table th, .test-cases-table td {
    padding: 0.75rem 0.5rem;
  }
  
  .test-cases-content {
    width: 100%;
  }
  
  .filter-icon {
    font-size: 1.2rem; /* Larger touch target */
  }
  
  .sort-icon {
    font-size: 1.3rem; /* Larger touch target */
  }
  
  .test-cases-table {
    font-size: 0.9rem;
  }
  
  .button.button-secondary {
    padding: 0.4rem 0.6rem;
    font-size: 0.8rem;
  }
}

@media (max-width: 480px) {
  body {
    padding: var(--space-2);
  }
  
  h1, h2, h3 {
    font-size: 90%;
  }
  
  .test-sets-table th, .test-cases-table th {
    font-size: 0.8rem;
  }
  
  .test-sets-table td, .test-cases-table td {
    font-size: 0.85rem;
  }
  
  .test-cases-content .test-cases-table th,
  .test-cases-content .test-cases-table td {
    padding: 0.5rem 0.3rem;
  }
  
  .test-cases-container {
    padding: 0.75rem;
  }
  
  .button.button-secondary {
    padding: 0.3rem 0.5rem;
    font-size: 0.75rem;
    white-space: nowrap;
  }
}

h1 {
  color: var(--primary-color);
  padding-bottom: var(--space-2);
  font-weight: var(--font-weight-bold);
  font-size: 1.8rem;
  margin-bottom: var(--space-4);
  border-bottom: 2px solid var(--border-color);
  position: relative;
}

h1::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 60px;
  height: 2px;
  background-color: var(--primary-color);
}

h2 {
  color: var(--primary-color);
  font-size: 1.5rem;
  margin: var(--space-4) 0 var(--space-3);
  padding-bottom: var(--space-2);
  border-bottom: 2px solid var(--border-color);
  position: relative;
  font-weight: var(--font-weight-bold);
}

h2::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 50px;
  height: 2px;
  background-color: var(--primary-color);
}

h3 {
  color: var(--primary-color);
  font-size: var(--font-size-large);
  margin: var(--space-4) 0 var(--space-3);
  padding-bottom: var(--space-2);
  border-bottom: 2px solid var(--border-color);
  position: relative;
  font-weight: var(--font-weight-medium);
}

h3::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 40px;
  height: 2px;
  background-color: var(--primary-color);
}

a {
  color: var(--primary-color);
  text-decoration: none;
  transition: color 0.2s;
  font-weight: var(--font-weight-medium);
}

a:hover {
  text-decoration: underline;
}

table {
  width: 100%;
  border-collapse: collapse;
  margin: var(--space-3) 0;
  background-color: white;
  border: none;
  border-left: none;
  border-right: none;
}

th, td {
  padding: var(--space-2);
  text-align: left;
  border: none;
}

td:last-child {
  font-size: var(--font-size-small);
  color: var(--legartis-grey);
}

/* LaTeX-style table rules */
table thead {
  border-top: 2px solid var(--accent-color);    /* toprule */
  border-bottom: 1px solid var(--accent-color); /* midrule after header */
}

table tbody {
  border-bottom: 2px solid var(--accent-color); /* bottomrule */
}

th {
  color: var(--accent-color);
  font-weight: var(--font-weight-medium);
  padding: var(--space-2) var(--space-3);
}


.container {
  width: 100%;
  /* margin-top: 30px; /\* Increased from 6px to accommodate the logo *\/ */
  margin-left: auto;
  margin-right: auto;
  /* max-width: 1200px; */
}

.nav-link {
  background-color: var(--primary-color);
  border: 2px solid var(--accent-color);
  position: relative;
  border-radius: 4px;
  transition: background-color 0.3s ease;
}

.nav-link:hover {
  background-color: var(--secondary-color);
}

.select-input {
  display: inline-block;
  margin-right: var(--space-2);
  width: 500px;
  max-width: 500px;
  padding: var(--space-2);
  font-size: var(--font-size-normal);
  line-height: 1.5;
  color: var(--text-color);
  background-color: white;
  border: 1px solid var(--border-color);
  border-radius: 4px;
  margin-bottom: var(--space-3);
  transition: all 0.2s ease;
  box-shadow: var(--shadow-sm);
  font-family: var(--font-family);
}

.select-input:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 2px rgba(18, 54, 132, 0.2);
}

#document-switcher {
    display: inline-block;
}

.selects-container {
    display: flex;
    gap: 12px; /* modern way to add spacing between flex items */
    align-items: center;
}

td:has(.checkbox-input) {
  text-align: center;
}

td ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

td li {
  padding: 0.25rem 0.5rem;
  border-bottom: 1px solid var(--border-color);
  transition: background-color 0.2s ease;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.li-segment-text, .li-segment-text-overwritten {
  list-style-type: none;
  margin-bottom: var(--space-1); 
}

td li:hover {
    text-decoration: underline;
}

.context-checkbox {
  width: 1rem;
  height: 1rem;
  accent-color: var(--primary-color);
  flex: 0 0 2rem;
}

/* Segment text styling */
.li-segment-text, .li-segment-text-overwritten {
  opacity: 0.8;
  position: relative;
  margin-right: 0px;
}

.li-segment-text {
  background-color: var(--background-color);
}

.li-segment-text-overwritten {
  background-color: rgba(231, 76, 60, 0.1);
}

.li-segment-text-overwritten:has(.context-checkbox:not(:checked))::before,
li.li-segment-text:has(.context-checkbox:not(:checked))::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  pointer-events: none;
}

.li-segment-text-overwritten:has(.context-checkbox:not(:checked))::before {
  background-image: repeating-linear-gradient(
    135deg,
    transparent,
    transparent 6px,
    rgba(231, 76, 60, 0.1) 6px,
    rgba(231, 76, 60, 0.1) 12px
  );
}

li.li-segment-text:has(.context-checkbox:not(:checked))::before {
  background-image: repeating-linear-gradient(
    45deg,
    transparent,
    transparent 6px,
    rgba(0, 0, 0, 0.1) 6px,
    rgba(0, 0, 0, 0.1) 12px
  );
}


td li:last-child {
  border-bottom: none;
}

.autocomplete-container {
    position: relative;
    width: 100%;
    max-width: 200px;
}

.input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.clear-button {
    position: absolute;
    right: 8px;
    top: 8px;
    /* transform: translateY(-50%); */
    background: none;
    border: none;
    font-size: 18px;
    color: #666;
    cursor: pointer;
    padding: 0 6px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.clear-button:hover {
    color: var(--primary-color);
}

.status-input {
    padding-right: 30px; /* Make room for the clear button */
}

.options-list {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 1px solid var(--border-color);
    border-radius: 0.375rem;
    margin-top: 4px;
    box-shadow: var(--shadow-md);
    display: none;
    z-index: 1000;
}

.status-input:focus + .clear-button + .options-list {
    display: block;
}

.option {
    padding: 8px 12px;
    cursor: pointer;
}

.option:hover {
    background-color: var(--background-color);
    color: var(--primary-color);
}

.status-input {
    width: 100%;
    min-width: 150px;
    padding: 0.5rem;
    border: 1px solid var(--border-color);
    border-radius: 0.375rem;
    background-color: white;
    color: var(--text-color);
    font-size: 0.875rem;
    margin-bottom: 0.5rem;
    transition: all 0.2s ease;
}

.status-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(18, 54, 132, 0.1);
}

/* Hide the datalist dropdown arrow in webkit browsers */
input::-webkit-calendar-picker-indicator {
    display: none !important;
}

.split-container {
  display: flex;
  height: calc(100vh - 11rem);
  margin: 0;
  width: 100%;
  max-width: none;
  background-color: var(--white-accent);
}

.document-side {
  flex: 1;
  overflow-y: auto;
  padding-right: var(--space-3);
}

.table-side {
  flex: 1;
  overflow-y: auto;
  padding-left: var(--space-3);
  padding-bottom: var(--space-3);
  padding-right: var(--space-2);
  border-radius: 1rem;
}

.document-container {
  flex: 1;
  overflow-y: auto;
  padding-left: var(--space-3);
  padding-bottom: var(--space-3);
  padding-right: var(--space-2);
  border-radius: 1rem;
}


.document-content {
  font-size: 1.1rem;
  line-height: 1.8;
  color: var(--text-color);
}

.paragraph {
  margin-bottom: 1.5rem;
  padding: 0.5rem;
  border-radius: 0.25rem;
  transition: background-color 0.2s ease;
}

.segment-container {
  display: inline;
  position: relative;
}

.segment-text {
  cursor: pointer;
}

.segment-id {
  background-color: var(--primary-color);
  border: 1px solid var(--accent-color);
  border-radius: 16px;
  padding: var(--space-1) var(--space-2);
  font-size: var(--font-size-small);
  color: var(--white-accent);
  display: inline-block;
  margin-right: var(--space-1);
  transition: background-color 0.3s ease, transform 0.2s ease;
}

.segment-id-inactive {
  background-color: var(--white-accent);
  border: 1px solid var(--primary-color);
  border-radius: 16px;
  padding: var(--space-1) var(--space-2);
  font-size: var(--font-size-small);
  color: var(--primary-color);
  display: inline-block;
  margin-right: var(--space-1);
  transition: background-color 0.3s ease, transform 0.2s ease;
}

.segment-id-rhs {
  background-color: var(--primary-color);
  border: 1px solid var(--accent-color);
  border-radius: 16px;
  padding: var(--space-1);
  margin: 1px;
  font-size: var(--font-size-small);
  color: var(--white-accent);
  display: inline-block;
  margin-right: var(--space-1);
  transition: background-color 0.3s ease, transform 0.2s ease;
}

.segment-id:hover {
  background-color: var(--secondary-color);
  transform: scale(1.05);
  box-shadow: var(--shadow-sm);
}

.hidden-segments-notice {
  padding: var(--space-2);
  font-size: var(--font-size-small);
  color: var(--legartis-grey);
  text-align: center;
  border-bottom: 1px dashed var(--border-color);
  list-style-type: none;
}

.segment {
  display: inline;
  padding: 0.1rem 0.2rem;
  border-radius: 0.125rem;
  transition: background-color 0.2s ease;
}

.document-title::before {
  content: '📄';
  margin-right: 0.5rem;
}

.split-container {
  background: white;
  /* border-radius: 1rem; */
  /* box-shadow: var(--shadow); */
  /* border: 1px solid var(--border-color); */
}

/* Material Design Button styles */
.button, .submit-button {
  display: inline-block;
  padding: var(--space-2) var(--space-4);
  font-size: var(--font-size-normal);
  font-weight: var(--font-weight-medium);
  text-align: center;
  text-decoration: none;
  background-color: var(--primary-color);
  color: white;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: var(--shadow-sm);
  margin: var(--space-2);
  text-transform: uppercase;
  letter-spacing: var(--letter-spacing-wide);
  position: relative;
  overflow: hidden;
}

.button:hover, .submit-button:hover {
  background-color: var(--secondary-color);
  box-shadow: var(--shadow-md);
  text-decoration: none;
}

.button:active, .submit-button:active {
  transform: translateY(1px);
}

.button::after, .submit-button::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 6px;
  height: 6px;
  background: rgba(255, 255, 255, 0.5);
  opacity: 0;
  border-radius: 100%;
  transform: scale(1, 1) translate(-50%);
  transform-origin: 50% 50%;
}

.button:focus:not(:active)::after, .submit-button:focus:not(:active)::after {
  animation: ripple 1s ease-out;
}

@keyframes ripple {
  0% {
    transform: scale(0, 0);
    opacity: 0.5;
  }
  20% {
    transform: scale(25, 25);
    opacity: 0.3;
  }
  100% {
    opacity: 0;
    transform: scale(40, 40);
  }
}

.button-secondary {
  background-color: transparent;
  color: var(--primary-color);
  border: 1px solid var(--primary-color);
  box-shadow: none;
  white-space: nowrap;
}

.button-secondary:hover {
  background-color: rgba(18, 54, 132, 0.05);
  color: var(--secondary-color);
  border-color: var(--secondary-color);
}

/* Specific button sizes */
.button-large {
  padding: 1rem 2rem;
  font-size: 1.1rem;
  min-width: 200px;
}

.button-small {
  padding: 0.5rem 1rem;
  font-size: 0.875rem;
}

.review-form {
  display: flex;
  gap: 1rem;
  align-items: flex-start;
  margin-top: 1rem;
  margin-bottom: 2rem;
}

.review-notes {
  flex: 1;
  min-height: 80px;
  padding: 1rem;
  border: 2px solid var(--border-color);
  border-radius: 0.75rem;
  font-family: inherit;
  font-size: 1rem;
  line-height: 1.6;
  resize: vertical;
  background-color: white;
  transition: all 0.3s ease;
  box-shadow: var(--shadow-sm);
}

.review-notes:hover {
  border-color: var(--secondary-color);
}

.review-notes:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(255, 107, 43, 0.2);
  transform: translateY(-1px);
}

.review-notes::placeholder {
  color: #94a3b8;
  font-style: italic;
}

.or-divider {
  position: relative;
  text-align: center;
  margin: 3rem 0;
  font-weight: 600;
  color: var(--accent-color);
  font-size: 1.2rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.or-divider::before,
.or-divider::after {
  content: '';
  position: absolute;
  top: 50%;
  width: calc(50% - 3rem);
  height: 2px;
  background: linear-gradient(to var(--direction, right), var(--border-color), var(--accent-color));
}

.or-divider::before {
  left: 0;
  --direction: right;
}

.or-divider::after {
  right: 0;
  --direction: left;
}

.button-group {
  display: flex;
  gap: 1rem;
  margin: 1.5rem 0;
  justify-content: center;
}


.name-input {
  width: 100%;
  max-width: 300px;
  padding: 0.75rem 1rem;
  font-size: 1rem;
  color: var(--text-color);
  background-color: white;
  border: 2px solid var(--border-color);
  border-radius: 0.5rem;
  margin-bottom: 1.5rem;
  transition: all 0.2s ease;
  box-shadow: var(--shadow-sm);
}

.name-input:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 2px rgba(255, 107, 43, 0.2);
}

.name-container {
  margin-bottom: 2rem;
  text-align: center;
}

.name-label {
  display: block;
  margin-bottom: 0.5rem;
  color: var(--accent-color);
  font-weight: 500;
}

.home-icon {
  text-decoration: none;
  font-size: 1.2rem;
  margin-right: 0.5rem;
  transition: transform 0.2s ease;
}

.home-icon:hover {
  transform: translateY(-1px);
  text-decoration: none;
}

/* User display styles consolidated */
.user-display {
  display: flex;
  align-items: center;
  padding: var(--space-2) var(--space-3);
  color: var(--text-color);
  transition: all 0.3s ease;
}

.user-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  line-height: 1.4;
}

.user-name {
  font-weight: var(--font-weight-bold);
  color: var(--primary-color);
  font-size: 1.2rem;
  position: relative;
}

.user-name::after {
  content: "\e5cf";
  margin-left: 5px;
  font-size: 1rem;
  font-family: 'Material Icons Outlined';
}

.expanded .user-name::after {
  content: "\e5ce";
  font-family: 'Material Icons Outlined';
}

.company-name {
  font-size: var(--font-size-small);
  color: var(--secondary-color);
}

.home-button {
  font-size: 1.25rem;
  color: var(--primary-color);
  transition: transform 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-right: 12px;
}

.home-button:hover {
  transform: scale(1.2);
  text-decoration: none;
}

.collapsible {
  background: linear-gradient(to right,
    #f4a261 var(--done-percent, 0%),
    #e9ecef var(--done-percent, 0%));
  color: #1a1a1a;
  cursor: pointer;
  padding: 1rem 1.5rem;
  width: 100%;
  border: none;
  text-align: left;
  outline: none;
  font-size: 1rem;
  margin: 0.5rem 0;
  position: relative;
  z-index: 1;
  border-radius: 0.5rem;
  font-weight: 600;
  letter-spacing: 0.025em;
  box-shadow: var(--shadow-md);
}

.active, .collapsible:hover {
  background: linear-gradient(to right,
    #e9c46a var(--done-percent, 0%),
    #e9ecef var(--done-percent, 0%));
}

.content {
  padding: 0;
  display: none;
  overflow: hidden;
  border-radius: 0.5rem;
  margin: 0.5rem 0;
}

.results-container {
    position: absolute;
    top: calc(100% + 4px);
    left: 0px;
    right: -100px;
    background: var(--white-accent);
    border-radius: 0.5rem;
    box-shadow: var(--shadow-md);
    max-height: 500px;
    overflow-y: auto;
    z-index: 1000;
    scroll-behavior: smooth;
    scrollbar-width: thin;
    scrollbar-color: var(--primary-color) var(--background-color);
}

/* Styling individual result items */
.results-container .result-item {
    padding: 0.75rem 1rem;
    cursor: pointer;
    transition: all 0.2s ease;
    border-bottom: 1px solid var(--border-color);
}

.results-container .result-item:last-child {
    border-bottom: none;
}

.results-container .result-item:hover {
    background-color: var(--background-color);
    color: var(--primary-color);
}

/* Highlight matched text */
.results-container .highlight {
    background-color: rgba(255, 107, 43, 0.1);
    color: var(--primary-color);
    padding: 0.1rem 0.2rem;
    border-radius: 0.2rem;
}

/* Empty state */
.results-container .no-results {
    padding: 1rem;
    text-align: center;
    color: #64748b;
    font-style: italic;
}

/* Webkit scrollbar styling */
.results-container::-webkit-scrollbar {
    width: 6px;
}

.results-container::-webkit-scrollbar-track {
    background: var(--background-color);
    border-radius: 3px;
}

.results-container::-webkit-scrollbar-thumb {
    background-color: var(--primary-color);
    border-radius: 3px;
}

@keyframes saveFlash {
  0% { box-shadow: 0 0 0 0 rgba(72, 187, 120, 0.4); }
  70% { box-shadow: 0 0 0 12px rgba(72, 187, 120, 0); }
  100% { box-shadow: 0 0 0 0 rgba(72, 187, 120, 0); }
}

.status-input.saved {
  animation: saveFlash 0.8s ease-out;
  border-color: var(--success-color);
}

.status-container {
    display: flex;
    align-items: center;
    margin-bottom: 15px;
}

.toggle {
    display: flex;
    align-items: center;
    cursor: pointer;
}

.toggle-checkbox {
    display: none;
}

.toggle-switch {
    position: relative;
    width: 60px;
    height: 34px;
    background-color: var(--border-color);
    border-radius: 34px;
    transition: background-color 0.3s;
    margin-right: 12px;
}

.toggle-switch::before {
    position: absolute;
    content: "";
    height: 26px;
    width: 26px;
    left: 4px;
    bottom: 4px;
    background-color: var(--white-accent);
    border-radius: 50%;
    transition: transform 0.3s;
}

.toggle-checkbox:checked + .toggle-switch {
    background-color: var(--primary-color);
}

.toggle-checkbox:checked + .toggle-switch::before {
    transform: translateX(26px);
}

.toggle-label {
    font-size: 1rem;
    font-weight: 500;
    color: var(--accent-color);
}

.toggle-checkbox.saved + .toggle-switch {
    box-shadow: 0 0 6px 2px rgba(255, 107, 43, 0.5);
}



.duration-value-input {
    width: 140px;
}

.duration-unit-select {
    flex-shrink: 0;
}

.duration-value-input, .duration-unit-select {
  background-color: var(--background-color);
  border: 1px solid var(--border-color);
  border-radius: 0.375rem;
  padding: 0.5rem 1rem;
  color: var(--text-color);
  font-size: 16px;
  transition: border-color 0.3s ease-in-out, box-shadow 0.3s ease-in-out;
  box-shadow: var(--shadow-sm);
}

.duration-value-input:focus, .duration-unit-select:focus {
  outline: none;
  border-color: var(--primary-color); /* Highlight border with primary color on focus */
  box-shadow: var(--shadow); /* Add a subtle shadow for depth */
}

.input-code {
  font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, Courier, monospace;
  background-color: #e2e8f0;
  color: var(--accent-color);
  border: 1px dashed var(--accent-color);
  padding: 0.75rem 1rem;
}

.input-code::placeholder {
  color: #64748b;
  font-style: normal;
}

.input-code:focus {
  border-color: var(--primary-color);
  border-style: solid; /* Solid border on focus */
  background-color: var(--white-accent); /* Brighter background on focus */
  box-shadow: 0 0 0 2px rgba(255, 107, 43, 0.3); /* Primary color focus ring */
}


.duration-value-input.saved, .duration-unit-select.saved {
  border-color: var(--accent-color);
  box-shadow: 0 0 0 4px rgba(15, 23, 42, 0.2);
}


/* HTMX indicator styling */
.htmx-indicator {
  display: none;
  text-align: center;
  padding: 20px;
}

.htmx-request.htmx-indicator {
  display: block;
}

/* Override padding and ensure correct display for htmx indicators that are also spinner-on-button */
.htmx-indicator.spinner-on-button.htmx-request {
  padding: 0; /* Remove padding from generic .htmx-request.htmx-indicator */
  margin: 0;  /* Reset any margin from a generic .spinner class if it were accidentally applied */
  /* The spinner-on-button class itself defines width, height, border, animation. */
  /* Inline styles in HTML handle display:inline-block, vertical-align:middle, and margin-left. */
}

/* Loading spinner - simplified version */
.spinner {
  width: 50px;
  height: 50px;
  border: 4px solid rgba(18, 54, 132, 0.2);
  border-radius: 50%;
  border-top: 4px solid var(--primary-color);
  border-right: 4px solid transparent;
  animation: spin 1s linear infinite;
  margin: 20px auto;
  position: relative;
}

.spinner::after {
  content: '';
  position: absolute;
  top: -4px;
  left: -4px;
  right: -4px;
  bottom: -4px;
  border-radius: 50%;
  border: 2px solid transparent;
  border-top-color: var(--secondary-color);
  opacity: 0.6;
  animation: spin 1.5s linear infinite reverse;
}

/* Spinner specifically for buttons */
.button .spinner-on-button {
  width: 24px;
  height: 24px;
  border: 3px solid rgba(255, 255, 255, 0.4);
  border-radius: 50%;
  border-top-color: #ffffff;
  animation: spin 1s linear infinite;
}

/* Class to add to button when loading */
.button.loading {
  display: inline-flex; /* Allows spinner to be centered */
  align-items: center;
  justify-content: center;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

.status-input.error {
  border-color: var(--error-color);
  box-shadow: 0 0 6px 2px rgba(231, 76, 60, 0.5);
  background-color: rgba(231, 76, 60, 0.05);
}

/* Test Sets Table Styles */
.test-sets-container {
  margin: 2rem 0;
}

/* Responsive table container */
.table-responsive {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin-bottom: 1rem;
  width: 100%;
  position: relative;
  min-height: 400px;
}

.test-sets-table, .test-cases-table {
  width: 100%;
  border-collapse: collapse;
  margin: 1rem 0;
  background-color: white;
  border-left: none;
  border-right: none;
  border-top: none;
  border-bottom: none;
}

.test-sets-table th, .test-sets-table td,
.test-cases-table th, .test-cases-table td {
  padding: 1rem;
  text-align: left;
  border: none;
  white-space: normal; /* Allow text wrapping */
  word-break: break-word; /* Break long words if needed */
}

.test-sets-table th {
  height: 60px;
  white-space: nowrap;
}

.test-sets-table thead, .test-cases-table thead {
  border-top: 2px solid var(--accent-color);    /* toprule */
  border-bottom: 1px solid var(--accent-color); /* midrule after header */
}

.test-sets-table tbody, .test-cases-table tbody {
  border-bottom: 2px solid var(--accent-color); /* bottomrule */
}

.test-sets-table th, .test-cases-table th {
  color: var(--accent-color);
  font-weight: 600;
}

.test-sets-table .button, .test-cases-table .button {
  padding: 0.5rem 1rem;
  font-size: 0.875rem;
  min-width: auto;
  margin: 0;
}

.test-set-detail h1 {
  margin-bottom: 1.5rem;
  color: var(--primary-color);
}

.test-set-detail h2 {
  margin: 2rem 0 1rem;
  color: var(--accent-color);
  border-bottom: 2px solid var(--border-color);
  padding-bottom: 0.5rem;
}

/* Sortable table styles */
.sortable {
  cursor: pointer;
  position: relative;
  user-select: none;
}

.sortable .sort-icon {
  cursor: pointer;
  font-size: 1.5rem;
}

.sort-icon {
  display: inline-block;
  margin-left: 6px;
  transition: transform 0.2s ease;
  font-size: 1.2rem;
  font-weight: bold;
}

th.sortable[data-sort-direction="asc"] .sort-icon {
  transform: rotate(180deg);
}

/* Add a subtle highlight to the sorted column */
table tbody tr td.sorted {
  background-color: rgba(255, 107, 43, 0.05);
}

/* Filter styles */
/* General filter styles from test_cases_view, potentially reusable */
.filter-th {
  position: relative;
}

.filter-icon {
  display: inline-block;
  margin-left: 8px;
  cursor: pointer;
  font-size: 1rem;
  opacity: 0.7;
  transition: opacity 0.2s ease;
  /* Material Icons properties for all filter icons */
  font-family: 'Material Icons Outlined', 'Material Icons';
  font-weight: normal;
  font-style: normal;
  font-size: 1.1rem; /* Consistent size */
  line-height: 1;
  letter-spacing: normal;
  text-transform: none;
  display: inline-block;
  white-space: nowrap;
  word-wrap: normal;
  direction: ltr;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  -moz-osx-font-smoothing: grayscale;
  font-feature-settings: 'liga';
  vertical-align: middle;
}

.filter-icon:hover {
  opacity: 1;
}

.filter-popup {
  position: absolute;
  top: 100%;
  left: 0;
  z-index: 1000;
  background-color: white;
  border: 1px solid var(--border-color);
  border-radius: 0.5rem;
  box-shadow: var(--shadow-md);
  padding: 1rem;
  min-width: 200px;
  display: none;
  max-height: 30D0; /* Increased from 300px */
  overflow-y: auto;
  /* position: fixed; Removed for relative positioning */
  color: var(--text-color);
  max-width: 90vw; /* Prevent overflow on small screens */
  /* --- Positioning relative to .filter-th --- */
  top: 100%; /* Position below the parent element */
  left: 0;   /* Align with the left edge of the parent */
  /* background-color: white; Already set */
  z-index: 1000; /* Ensure it's above other elements, was 1001, 1000 is likely fine */
  /* border: 1px solid red; Removed debug border */
  min-height: 50px; /* Ensure it has some visible height if content is sparse */
}

.filter-popup.show {
  display: block;
}

.filter-header {
  font-weight: bold;
  margin-bottom: 0.5rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border-color);
  color: var(--accent-color);
}

.filter-options {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  color: var(--text-color);
}

.filter-input {
  width: calc(100% - 2rem); /* Adjust width considering padding */
  padding: 0.75rem 1rem;
  margin-bottom: 1rem; /* Space before options */
  font-size: 0.875rem;
  border: 1px solid var(--border-color);
  border-radius: 0.5rem;
  background-color: white;
  color: var(--text-color);
  transition: all 0.2s ease;
  box-shadow: var(--shadow-sm);
}

.filter-input:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 2px rgba(255, 107, 43, 0.2);
}

.filter-option {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
  padding: 0.5rem 0; /* Increased padding for better touch targets */
}

.filter-option:hover {
  color: var(--primary-color);
}

.filter-option input[type="checkbox"] {
  accent-color: var(--primary-color);
  margin-right: var(--space-1); /* Add some space between checkbox and label text */
}

/* Styling for the placeholder text in annotator filter popup */
.filter-options .no-annotators-loaded {
  font-style: italic;
  color: var(--medium-dark-grey);
  padding: var(--space-1) 0;
}

/* Ensure the #status-filter-icon specific styles are removed if .filter-icon now handles them */
/* #status-filter-icon { ... } */ /* This block can be removed if .filter-icon covers it */


/* Accordion styles for test cases */
.acp-row {
  cursor: pointer;
  transition: all 0.3s ease;
  position: relative;
}

.acp-row:hover {
  box-shadow: var(--shadow-sm);
}

.acp-row::after {
  content: "\e5cf";
  font-family: 'Material Icons Outlined';
  position: absolute;
  right: 15px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--primary-color);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.acp-row:hover::after {
  opacity: 1;
}

/* Make expand icon always visible on mobile for better UX */
@media (max-width: 768px) {
  .acp-row::after {
    opacity: 0.7;
    font-size: 1.2rem; /* Larger icon for touch */
    right: 10px;
  }
}

.test-cases-row td {
  padding: 0;
}

.test-cases-container {
  padding: 1.5rem;
  border-top: 3px solid var(--primary-color);
  border-bottom: 1px solid var(--border-color);
  box-shadow: inset 0 12px 15px -12px rgba(0, 0, 0, 0.1);
  transition: all 0.5s ease;
  position: relative;
  overflow: hidden;
}

.test-cases-content {
    width: 95%;
    margin: 0 auto;
}

.test-cases-content h3 {
  margin-top: 0;
  color: var(--primary-color);
  font-size: 1.3rem;
  border-bottom: 2px solid var(--border-color);
  padding-bottom: 0.75rem;
  margin-bottom: 1.5rem;
  position: relative;
  display: inline-block;
}

.test-cases-content h3::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 50%;
  height: 2px;
  background-color: var(--primary-color);
}

.test-cases-content .test-cases-table {
  margin-top: 1rem;
  border: none;
}

.test-cases-content .test-cases-table thead {
  border-top: 2px solid var(--accent-color);    /* toprule */
  border-bottom: 1px solid var(--accent-color); /* midrule after header */
}

.test-cases-content .test-cases-table tbody {
  border-bottom: 2px solid var(--accent-color); /* bottomrule */
}

.test-cases-content .test-cases-table th {
  /* color: var(--accent-color); */
  padding: 1rem 1.25rem;
  font-weight: 600;
  letter-spacing: 0.5px;
  border: none;
}

.test-cases-content .test-cases-table td {
  color: var(--text-color);
  padding: 1rem 1.25rem;
  border: none;
  transition: background-color 0.2s ease;
  word-break: break-word;
}


.test-cases-content .test-cases-table tr:last-child td {
  border-bottom: none;
}

.info-icon {
  display: inline-block;
  width: 18px;
  height: 18px;
  background-color: var(--legartis-grey);
  color: white;
  border-radius: 50%;
  text-align: center;
  line-height: 18px;
  font-size: 12px;
  margin-left: 8px;
  cursor: help;
  position: relative;
  font-weight: bold;
}

.info-tooltip {
  visibility: hidden;
  width: 300px;
  background-color: var(--white-accent);
  color: var(--text-color);
  text-align: left;
  border-radius: 6px;
  padding: 10px;
  position: absolute;
  z-index: 1;
  top: 125%;
  left: 50%;
  margin-left: -150px;
  opacity: 0;
  transition: opacity 0.3s;
  box-shadow: var(--shadow-md);
  border: 1px solid var(--border-color);
  font-weight: normal;
  font-style: normal;
  font-size: 14px;
  line-height: 1.5;
}

.info-icon:hover .info-tooltip {
  visibility: visible;
  opacity: 1;
}


/* Loading spinner is now unified with .spinner class */

.htmx-indicator {
    text-align: center;
    padding: 20px;
}

.logout-container {
    margin-left: 1.0rem;
}

.user-area {
  position: relative; /* To anchor userSectionExpanded */
}

#userSection {
  background-color: transparent;
  /* position: absolute; Removed */
  /* top: 10px; Removed */
  /* right: 20px; Removed */
  width: auto; /* Keeps it shrink-to-fit */
  max-width: 400px; /* Retain max-width if necessary */
  /* z-index: 2; Not needed in this way, or handled by top-bar */
  cursor: pointer;
  /* position: relative; Removed, user-area is the context */
}

#userSectionExpanded {
  display: none;
  background-color: var(--background-color);
  border-radius: 8px;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2), 0 6px 12px rgba(0, 0, 0, 0.15);
  overflow: hidden;
  position: absolute;
  top: 100%; /* Position below userSection (which is inside user-area) */
  right: 0;   /* Align to the right of user-area */
  width: auto;
  min-width: 250px; /* Ensure it has some minimum width for content like select dropdown */
  max-width: 400px;
  z-index: 1001; /* Ensure it's above other top-bar items and main content */
}


.logout-button {
  background-color: transparent;
  color: var(--primary-color);
  border: 1px solid var(--primary-color);
  border-radius: 4px;
  padding: var(--space-1) var(--space-2);
  font-size: var(--font-size-small);
  text-decoration: none;
  transition: all 0.3s ease;
  display: inline-block;
  text-transform: uppercase;
  letter-spacing: var(--letter-spacing-normal);
  font-weight: var(--font-weight-medium);
}

#userSectionExpanded .logout-button {
  background-color: var(--error-color);
  color: white;
  border-color: var(--error-color);
}

.logout-button:hover {
  background-color: var(--legartis-red);
  color: white;
  border-color: var(--legartis-red);
  text-decoration: none;
}

@media (max-width: 600px) {
  .user-display {
    flex-direction: column;
    align-items: flex-start;
  }  
}

/* Progress bar styles */
.progress-bar-container {
  width: 100%;
  background-color: var(--extra-light-grey);
  border-radius: 4px;
  margin-top: var(--space-2); /* Space above the progress bar */
  margin-bottom: var(--space-3); /* Space below the progress bar */
  padding: 2px;
  position: relative;
  height: 24px;
  box-shadow: var(--shadow-sm);
  text-align: center;
}

.progress-bar-fill {
  height: 100%;
  background-color: var(--success-color);
  border-radius: 2px;
  transition: width 0.5s ease-in-out;
}

.progress-bar-text {
  position: absolute;
  width: 100%;
  top: 50%;
  left: 0;
  transform: translateY(-50%);
  color: var(--text-color); /* Adjust if contrast with fill is an issue */
  font-size: var(--font-size-small);
  font-weight: var(--font-weight-medium);
  text-align: center;
  z-index: 1; /* Ensure text is above the fill */
  pointer-events: none; /* So text doesn't interfere with any underlying elements if needed */
}

/* Main Navigation Menu Styles */
.main-navigation {
  /* width: 100%; Removed, it's a flex item now */
  background-color: transparent;
  padding: var(--space-1) 0; /* This padding is for top/bottom */
  /* margin-bottom: var(--space-4); Removed, spacing handled by top-bar or its children */
  border-radius: 4px;
  border: 1px solid var(--primary-color); /* Added: Blue border */
  display: flex;
  justify-content: center; /* Center the menu items */
  margin-left: 2rem;
  margin-right: 2rem;
}

.nav-menu {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-wrap: wrap; /* Allow items to wrap on smaller screens */
  justify-content: center;
}

.nav-item {
  margin: 0 var(--space-1); /* Spacing between items */
}

.nav-menu-link {
  display: block;
  padding: var(--space-2) var(--space-3);
  color: var(--primary-color); /* Changed from white-accent */
  text-decoration: none;
  font-weight: var(--font-weight-medium);
  font-size: var(--font-size-normal);
  border-radius: 4px;
  transition: background-color 0.3s ease, color 0.3s ease;
  text-transform: uppercase;
  letter-spacing: var(--letter-spacing-normal);
}

.nav-menu-link:hover {
  background-color: rgba(18, 54, 132, 0.05); /* Light primary shade on hover */
  color: var(--secondary-color); /* Darker blue text on hover */
  text-decoration: none;
}

.nav-menu-link.active { /* Add 'active' class to current page link via JS or server-side if possible */
  background-color: rgba(18, 54, 132, 0.1); /* Slightly darker primary shade for active */
  color: var(--secondary-color); /* Consistent with hover text color */
  font-weight: var(--font-weight-bold);
}

/* Responsive adjustments for navigation */
@media (max-width: 768px) {
  .main-navigation {
    padding: var(--space-1) 0;
    width: 60%; /* Make items take more width */
  }
  .nav-menu-link {
    padding: var(--space-1) var(--space-2);
    font-size: var(--font-size-small);
  }
  .nav-item {
    margin: var(--space-0-5) var(--space-1); /* Smaller margins for wrapped items */
  }
}

@media (max-width: 480px) {
  .nav-menu {
    flex-direction: column; /* Stack items vertically on very small screens */
    align-items: center;
  }
  .nav-item {
    width: 60%; /* Make items take more width */
    text-align: center;
    margin: var(--space-0-5) 0;
  }
  .nav-menu-link {
     width: 100%;
  }
}

/* Styles for Manage Page */
.manage-table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: var(--space-4);
}
.manage-table th, .manage-table td {
  /* Using existing table styles from .test-sets-table */
}
.manage-table th:first-child, .manage-table td:first-child { /* Checkbox column */
  width: 30px;
  text-align: center;
}
.details-loading {
  color: var(--legartis-grey);
  font-style: italic;
}
.manage-options-menu {
  padding: var(--space-3);
  border: 1px solid var(--border-color);
  background-color: var(--legartis-extra-light-grey-blue); /* Light blueish background */
  margin-bottom: var(--space-4);
  border-radius: 4px;
  box-shadow: var(--shadow-sm);
  max-width: 800px; /* Limit width on wider screens */
  margin-left: 0; /* Ensure left alignment (though default for block) */
  /* margin-right: auto; Removed for strict left alignment */
}
.manage-options-menu h3 {
  margin-top: 0;
  margin-bottom: var(--space-3);
  font-size: var(--font-size-medium); /* Smaller heading */
  border-bottom: 1px solid var(--border-color);
  padding-bottom: var(--space-2);
}
.manage-options-menu h3::after { /* Remove underline from h3 */
    content: none;
}
.manage-options-menu label {
  margin-right: var(--space-2);
  font-weight: var(--font-weight-medium);
  color: var(--text-color);
}
.manage-options-menu .select-input,
.manage-options-menu .status-input, /* Using existing status-input for consistency */
.manage-options-menu .button {
  margin-right: var(--space-3);
  margin-bottom: var(--space-2); /* Add some bottom margin for spacing if they wrap */
}
.manage-options-menu .button .htmx-indicator.spinner-on-button {
    margin-left: var(--space-1);
    width: 16px; /* Smaller spinner for these buttons */
    height: 16px;
    border-width: 2px;
}

/* Compact list style for status/annotator breakdowns */
ul.compact-list {
  list-style: none;
  padding: 0;
  margin: 0;
  font-size: var(--font-size-small);
}
ul.compact-list li {
  padding: 2px 0;
  border-bottom: none; /* Override general td li styles */
}
ul.compact-list li:hover {
    text-decoration: none; /* Override general td li styles */
    background-color: transparent;
}

.error-message {
  color: var(--error-color);
  background-color: rgba(255, 0, 0, 0.1);
  border: 1px solid var(--error-color);
  padding: var(--space-2);
  margin-bottom: var(--space-3);
  border-radius: 4px;
}

/* Status Progress Bar for Manage Page */
.status-progress-bar-container {
  display: flex;
  width: 100%;
  height: 20px; /* Adjust height as needed */
  background-color: var(--extra-light-grey); /* Fallback background for empty space */
  border-radius: 4px;
  overflow: hidden; /* Ensures segments stay within rounded corners */
  margin-bottom: var(--space-1); /* Space between bar and text list */
  box-shadow: inset 0 1px 2px rgba(0,0,0,0.1);
}

.status-progress-segment {
  height: 100%;
  transition: width 0.3s ease-in-out;
  display: flex; /* For potential text inside, though using title for now */
  align-items: center;
  justify-content: center;
  font-size: var(--font-size-tiny);
  color: white; /* Default text color for segments, adjust per status if needed */
  text-shadow: 1px 1px 1px rgba(0,0,0,0.2);
}

/* Specific colors for each status segment */
.status-segment-created {
  background-color: var(--legartis-grey); /* Grey for 'created' */
}
.status-segment-ready-for-assignment {
  background-color: var(--legartis-dark-yellow); /* Yellow/Orange for 'ready_for_assignment' */
}
.status-segment-assigned {
  background-color: var(--secondary-color); /* Blue for 'assigned' */
}
.status-segment-annotation-completed,
.status-segment-done { /* 'done' and 'annotation_completed' share the same color */
  background-color: var(--success-color); /* Green for 'completed'/'done' */
}

/* Style for clickable rows in manage table */
.manage-table .clickable-row {
  cursor: pointer;
}

.manage-table .clickable-row:hover {
  background-color: var(--legartis-extra-light-grey-blue); /* Subtle hover effect */
}

.manage-table tr.row-selected {
  background-color: var(--legartis-light-grey-blue) !important; /* Prominent selection color, use !important to override hover if needed */
  font-weight: var(--font-weight-medium); /* Slightly bolder text */
}

.manage-table tr.row-selected td {
  color: var(--primary-color); /* Change text color for contrast if needed */
}

/* Ensure checkbox itself is still visible and clickable */
.manage-table tr.row-selected td input[type="checkbox"] {
  /* Styles for checkbox if needed, usually browser default is fine */
}


/* Batch Actions Form Grid Layout */
.batch-actions-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); /* Responsive columns */
  gap: var(--space-4); /* Gap between columns */
  align-items: start; /* Align items to the start of their grid area */
}

.action-column {
  display: flex;
  flex-direction: column; /* Stack label, input/select, and button vertically */
  gap: var(--space-1); /* Space between elements within a column */
}

.action-column label {
  margin-bottom: var(--space-0-5); /* Small space below label */
  font-weight: var(--font-weight-medium);
}

.action-column .select-input,
.action-column .status-input {
  width: 100%; /* Make input/select take full width of the column */
  margin-bottom: var(--space-1); /* Space below input/select before button */
}

/* Specific adjustments for .select-input within .action-column for height alignment */
.action-column .select-input {
  padding-top: 0.5rem;    /* Match status-input vertical padding */
  padding-bottom: 0.5rem; /* Match status-input vertical padding */
  /* Horizontal padding (var(--space-2)) is inherited from the general .select-input rule */
  line-height: normal;    /* Match typical input line-height for better height consistency */
  border-radius: 0.375rem; /* Match status-input border-radius for visual consistency */
}

.action-column .button {
  width: 100%; /* Make button take full width of the column */
  margin-top: auto; /* Pushes button to the bottom if column heights vary and inputs are different sizes */
  margin-right: 0; /* Override general button margin if any */
  margin-left: 0; /* Override general button margin if any */
}

/* Ensure htmx indicators in buttons are handled correctly */
.action-column .button .htmx-indicator.spinner-on-button {
    margin-left: var(--space-1);
    width: 16px;
    height: 16px;
    border-width: 2px;
}

/* Styles for Test Cases View (All Test Cases page) */
.filterable-table tbody tr.test-case-data-row > td {
  border-top: 1px solid var(--light-grey);
}

.filterable-table tbody tr.diff-details-row > td {
  border-top: none; /* Ensures visual connection to the row above */
  padding-top: 0; /* Remove top padding to make it look more connected */
  padding-bottom: var(--space-1); /* Add some bottom padding for separation from next data row's top border */
  /* Horizontal padding will be inherited or can be set on .diff-content */
}

/* Styles for Test Cases View (formerly Legacy Manage) */
.test-set-summary-row.clickable-row { /* Ensure clickable row styles apply */
  cursor: pointer;
}
.test-set-summary-row.clickable-row:hover {
  background-color: var(--legartis-extra-light-grey-blue);
}

.test-case-expansion-row td {
  padding: 0; /* Remove padding from the cell that holds the nested table */
  border-top: none; /* Avoid double borders if summary row has bottom border */
}

.test-case-details-container {
  padding: var(--space-3); /* Padding inside the container for the nested table */
  background-color: var(--legartis-extra-light-grey-blue); /* Slightly different background for distinction */
  border-top: 2px solid var(--primary-color); /* Separator line */
}

.nested-test-case-table {
  width: 100%;
  border-collapse: collapse;
  margin: 0; /* Reset margin if any from general table styles */
  background-color: var(--white-accent); /* White background for the nested table itself */
}

.nested-test-case-table thead {
  border-top: 1px solid var(--secondary-color);
  border-bottom: 1px solid var(--secondary-color);
}
.nested-test-case-table th {
  background-color: var(--legartis-extra-light-grey-blue); /* Light header for nested table */
  color: var(--secondary-color);
  font-weight: var(--font-weight-medium);
  padding: var(--space-2);
  text-align: left;
}

.nested-test-case-table tbody tr:nth-child(even) {
  background-color: var(--legartis-extra-light-grey-blue); /* Zebra striping for readability */
}
.nested-test-case-table tbody tr:hover {
  background-color: var(--legartis-light-grey-blue); /* Hover effect */
}

.nested-test-case-table td {
  padding: var(--space-2);
  border-bottom: 1px solid var(--border-color); /* Light lines between rows */
  font-size: var(--font-size-small);
}
.nested-test-case-table td:last-child { /* Action button column */
  text-align: center;
}

.toggle-details-btn .arrow-icon {
  display: inline-block;
  transition: transform 0.2s ease-in-out;
  margin-left: var(--space-1);
}
/* No specific rotation needed here as textContent changes for arrow */

/* Styles for Filter Row in Tables */
.filterable-table .filter-row td {
  padding: var(--space-1) var(--space-1); /* Adjust padding for filter cells */
  border-bottom: 1px solid var(--border-color); /* Separator line */
  vertical-align: bottom; /* Align items to bottom for better baseline with new input style */
}

.filter-input {
  width: 100%;
  font-size: var(--font-size-small);
  background-color: var(--legartis-extra-light-grey-blue); /* Material "filled" background */
  border: none; /* Remove default border */
  border-bottom: 1px solid var(--medium-light-grey); /* Default underline */
  border-top-left-radius: 4px; /* Material-like top radius */
  border-top-right-radius: 4px;
  padding: var(--space-2) var(--space-2) var(--space-1); /* Top, H, Bottom padding */
  box-sizing: border-box;
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
  appearance: none; /* Remove default system appearance for select */
  -webkit-appearance: none;
  -moz-appearance: none;
}

.filter-input:hover {
  border-bottom-color: var(--default-grey);
}

.filter-input:focus {
  outline: none;
  border-bottom: 2px solid var(--primary-color); /* Thicker, colored underline on focus */
  padding-bottom: calc(var(--space-1) - 1px); /* Adjust padding to account for thicker border */
  box-shadow: 0 1px 0 0 var(--primary-color); /* Subtle top shadow on focus, optional */
  background-color: var(--legartis-extra-light-grey-blue); /* Keep background on focus */
}

.text-filter-input {
  /* Specific styles for text inputs if needed */
}

.select-filter-input {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23565656'%3E%3Cpath d='M7 10l5 5 5-5H7z'/%3E%3C/svg%3E"); /* Custom dropdown arrow */
  background-repeat: no-repeat;
  background-position: right var(--space-2) center;
  background-size: 1.2em;
  padding-right: calc(var(--space-2) + 1.5em); /* Make space for the arrow */
}

.select-filter-input:focus {
   background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23123684'%3E%3Cpath d='M7 10l5 5 5-5H7z'/%3E%3C/svg%3E"); /* Arrow color change on focus */
}


.filterable-table th .htmx-indicator { /* Spinner for filter loading */
    height: 1em;
    width: 1em; /* Adjust size as needed */
    vertical-align: middle;
    margin-left: var(--space-1);
    border-width: 2px; /* Make spinner lines thinner */
}

/* User Menu Styles */
.user-area {
  /* display: flex; and align-items: center; are already applied via inline style in HTML,
     but should be here if that inline style is removed.
     The request was to move styles *I* added. The flex for user-area was one.
  */
  display: flex;
  align-items: center;
  position: relative; /* For dropdown positioning */
}

.company-selector-container .company-display.clickable-company {
  cursor: pointer;
  display: flex;
  align-items: center;
}

.company-selector-container .company-display.clickable-company span:first-child { /* Target the company name text */
  font-weight: var(--font-weight-bold); /* 700 */
  color: var(--primary-color); /* #123684 */
  font-family: var(--font-family); /* Raleway */
  font-size: 1.0rem; /* Custom value */
  /* cursor: pointer; is already on the parent div */
}

.company-selector-container .company-display.static-company {
  padding-right: 10px; /* Custom value, not directly matching a var */
}

.dropdown-menu { /* Base class for user and company dropdowns */
  display: none; /* JS controls visibility */
  position: absolute;
  background-color: var(--background-color);
  border: 1px solid var(--border-color); /* #ccc -> var(--border-color) is #d6d6d6 */
  z-index: 1000;
  top: 100%;
  box-shadow: var(--shadow-md);
  border-radius: 4px; /* Added for consistency */
}

.company-dropdown {
  right: 34px; /* Align with companySelectorTrigger arrow: user-icon margin-left (10px) + user-icon width (24px) */
  min-width: 292px; /* Increased by 25% from 234px */
  max-height: 270px; /* Approx 5 items */
  overflow-y: auto;
}

/* Remove old .user-dropdown styles or ensure they don't conflict if .user-profile-sidebar is used */
/* .user-dropdown (styles removed by changing class in HTML) */

.user-profile-sidebar {
  position: fixed;
  top: 0; /* Span full page height */
  right: 0;
  width: var(--sidebar-width);
  height: 100vh; /* Span full page height */
  background-color: var(--primary-color); /* legartis dark blue */
  color: var(--white-accent);
  padding: var(--space-4); /* More padding for a sidebar */
  box-shadow: -2px 0 5px rgba(0,0,0,0.5); /* Shadow on the left */
  /* transform: translateX(100%); */ /* Removed for no animation */
  /* transition: transform 0.3s ease-in-out; */ /* Removed for no animation */
  z-index: 1050; /* Higher than other elements */
  overflow-y: auto; /* Scroll if content overflows */
  display: none; /* Hidden by default */
  flex-direction: column; /* Retained from original for internal layout */
}

.user-profile-sidebar.visible {
  /* transform: translateX(0); */ /* Removed for no animation */
  display: flex; /* Shown, using flex as it was defined for the base class */
}

.sidebar-internal-close-icon {
  position: absolute;
  top: 40px; /* Adjusted to be a bit lower */
  right: 42px; /* Moved a couple pixels to the left */
  cursor: pointer;
  width: 24px; /* Same as top bar icon */
  height: 24px; /* Same as top bar icon */
  filter: invert(1) brightness(2); /* Make SVG white for dark background */
}

.dropdown-item.company-item {
  display: block;
  width: 100%;
  padding: var(--space-2) var(--space-3); /* Increased padding: 12px 18px */
  text-align: left;
  border: none;
  background: none;
  cursor: pointer;
  color: var(--text-color);
  font-family: var(--font-family);
  font-size: var(--font-size-normal); /* Changed from normal to large (1.25rem) */
  font-weight: var(--font-weight-normal); /* Changed from medium to normal (400) */
  letter-spacing: 0.006rem; /* Added letter spacing */
}

.dropdown-item.company-item:hover {
  background-color: var(--extra-light-grey); /* More noticeable grey background on hover */
  color: var(--text-color); /* Keep text color same as non-hover state */
}

/* Spinner inside company item button */
.company-item .htmx-indicator.spinner-on-button {
  /* display:none; is initial state, htmx-request class handles visibility */
  margin-left: var(--space-1); /* 5px -> var(--space-1) is 6px */
  vertical-align: middle;
  /* width, height, border, animation are from .spinner-on-button */
}

.user-profile-menu-container .user-icon { /* General user icon style */
  height: 24px;
  width: 24px;
  margin-left: 10px; /* Custom value */
}
.user-profile-menu-container .user-icon.clickable-user-icon { /* Specific for clickable one */
  cursor: pointer;
  color: var(--primary-color); /* Make icon dark blue */
  position: relative;
  top: 2px; /* Adjust to lower the icon slightly */
}

/* Styles for content within the new sidebar */
.user-profile-sidebar table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 40px; /* Increased space: icon bottom (64px) + 50px desired space - sidebar padding (24px) */
  /* border: none; Removed */
  /* border-top: 2px solid var(--white-accent); Removed Toprule */
  background-color: transparent; /* Ensure it inherits sidebar background */
}

.user-profile-sidebar th, .user-profile-sidebar td {
  padding: var(--space-2) 0; /* Vertical padding, no horizontal for full width feel */
  text-align: left;
  border: none;
  font-size: var(--font-size-medium); /* Slightly larger font in sidebar */
  color: var(--white-accent); /* White text */
}

.user-profile-sidebar tr {
  /* border-bottom: 1px solid var(--secondary-color); Removed general rule */
}
.user-profile-sidebar tr:nth-child(1) { /* User name row */
  /* border-bottom: 1px solid var(--white-accent); Removed Midrule */
}
/* .user-profile-sidebar tr:nth-child(2) rule removed as the email row is gone */
.user-profile-sidebar tr:last-child { /* Logout row (which is now the 2nd row) */
  /* border-bottom: none; Removed */
  /* border-bottom: 2px solid var(--white-accent); Removed Bottomrule */
}

.user-profile-sidebar .user-info-cell {
  text-align: right;
}

.user-profile-sidebar .user-full-name {
  /* Inherits font-size and color from td. Add specific styles if needed. */
  /* For example: font-weight: var(--font-weight-medium); */
}

.user-profile-sidebar .user-email-text { /* Was .user-email-cell */
  font-weight: var(--font-weight-normal); /* Kept as not bold */
  /* cursor: default; */
  color: var(--white-accent); /* Ensure email is also white */
  /* font-family: var(--font-family); is inherited */
  font-size: var(--font-size-small); /* Changed from tiny to small */
  word-break: break-all; /* Break long emails */
}

.user-profile-sidebar .logout-button-container {
    margin-top: var(--space-8); /* Increased from --space-4 */
    /* text-align: center; Removed */
}

.user-profile-sidebar a.logout-button {
  background-color: transparent;
  color: var(--white-accent);
  border: 1px solid var(--white-accent); /* Retain border for the clickable area */
  padding: var(--space-2) var(--space-3); /* Adjust padding as needed */
  font-size: var(--font-size-normal);
  font-weight: var(--font-weight-medium);
  text-transform: uppercase;
  letter-spacing: var(--letter-spacing-normal);
  text-decoration: none;
  display: flex; /* Use flex to position text and icon */
  justify-content: space-between; /* Puts text left, icon right */
  align-items: center; /* Vertically align text and icon */
  width: 100%; /* Make the link take full width of td */
  border-radius: 4px;
  transition: background-color 0.2s, color 0.2s;
}

.user-profile-sidebar a.logout-button span {
  /* Styles for the "Logout" text if needed, e.g., margin */
}

.user-profile-sidebar a.logout-button .logout-icon {
  width: 20px; /* Adjust size as needed */
  height: 20px; /* Adjust size as needed */
  filter: invert(1) brightness(2); /* Make SVG white */
}

.user-profile-sidebar a.logout-button:hover {
  background-color: var(--white-accent);
  color: var(--primary-color); /* Dark blue text on white hover */
  text-decoration: none;
}

.user-profile-sidebar a.logout-button:hover .logout-icon {
  filter: brightness(0) saturate(100%) invert(18%) sepia(79%) saturate(2935%) hue-rotate(217deg) brightness(90%) contrast(90%); /* --primary-color */
}

.sidebar-footer-text {
  margin-top: auto; /* Pushes to the bottom */
  padding-top: var(--space-3); /* Space above the text */
  text-align: center;
  font-size: var(--font-size-tiny);
  color: var(--legartis-light-grey-blue); /* Lighter grey for less emphasis */
  opacity: 0.7;
}

/* Mode Selector Buttons in create.html */
.mode-selector .button.mode-button {
  flex-grow: 1; /* Ensure buttons fill the space */
  /* Base style for mode buttons (will be the inactive style) */
  background-color: var(--extra-light-grey); /* Light grey background */
  color: var(--legartis-grey); /* Medium grey text */
  border: 1px solid var(--light-grey); /* Light grey border */
  /* Overrides .button default white text and primary-color background */
}

.mode-selector .button.mode-button:hover {
  /* Slightly darker grey on hover for inactive button */
  background-color: var(--light-grey);
  border-color: var(--medium-light-grey);
  color: var(--default-grey);
}

.mode-selector .button.mode-button.active {
  /* Active button style */
  background-color: var(--white-accent); /* White background */
  color: var(--primary-color); /* Dark blue text */
  border: 1px solid var(--primary-color); /* Standard blue 1px border */
  font-weight: var(--font-weight-bold); /* Make active text bolder */
}

.mode-selector .button.mode-button.active:hover {
  /* Hover for active button */
  background-color: var(--legartis-extra-light-grey-blue); /* Very light blue tint */
  border-color: var(--secondary-color); /* Darker blue border */
  color: var(--secondary-color); /* Darker blue text */
}
