@layer pages {
/* Problems page */

.problem-link {
  cursor: pointer;
  text-decoration: none;
  color: var(--neutral-900) !important;
}

.problem-box-text {
  padding-top: 8px;
}

.problem-box-text a {
  color: white;
  text-decoration: underline;
}

[data-problem-status='problem'] {
  background-color: var(--status-problem);
  color: var(--neutral-900);
}

[data-problem-status='workaround_found'] {
  background-color: var(--status-workaround_found);
  color: var(--neutral-900);
}

[data-problem-status='solution_found'] {
  background-color: var(--status-solution_found);
  color: var(--neutral-900);
}

.with-images + .select2-container .select2-selection--single {
  min-height: 34px;
  max-height: 34px;
  overflow-y: auto;
}

#problems_opened td:first-child,
table.problems td:first-child {
  width: 100px;
  text-align: right;
}

span.problem,
span.problem-status {
  padding: 0 8px;
  color: var(--neutral-900);
  font-size: 96%;
}

.high > td:first-child { background-color: var(--priority-high); }
.medium > td:first-child { background-color: var(--priority-medium); }
.low > td:first-child { background-color: var(--priority-low); }
.urgent > td:first-child { background-color: var(--priority-urgent); }

.high > td:first-child,
.medium > td:first-child,
.low > td:first-child,
.urgent > td:first-child {
  color: var(--neutral-900);
}

.high > td:first-child a,
.medium > td:first-child a,
.low > td:first-child a,
.urgent > td:first-child a {
  color: var(--neutral-900);
}

.priority {
  font-weight: 800;
  color: var(--neutral-900);
}

.frame--problems {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  padding: 0.9375rem;
}

.problem {
  font-size: var(--font-size-sm);
  display: grid;
  column-gap: 0.625rem;
  row-gap: 0.3125rem;
  padding: 0.625rem;
  border: 1px solid var(--neutral-100);
  border-radius: 4px;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  grid-template-columns: 1.875rem 8.125rem 7.5rem 7.5rem 12.5rem 5rem 1fr;
  grid-template-rows: 1fr 1.25rem;
  grid-template-areas:
    "assigned-to id client service description sla priority"
    "assigned-to status client service description sla priority";
}

.problem:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px 0 rgba(0, 0, 0, 0.1);
}

.problem__assigned-to {
  grid-area: assigned-to;
}

.problem__id {
  grid-area: id;
}

.problem__client {
  grid-area: client;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 100%;
  flex-grow: 1;
  flex-basis: 180px;
}

.problem__service {
  grid-area: service;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 100%;
  flex-basis: 200px;
}

.problem__description {
  grid-area: description;
}

.problem__description--truncated {
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  max-width: 13.75rem;
}

.problem__status {
  grid-area: status;
  white-space: nowrap;
}

.problem__priority {
  grid-area: priority;
}

.problem__sla {
  grid-area: sla;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.problem--card {
  padding: 16px;
  border-radius: 8px;
  margin-bottom: 16px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--shadow-color);
  justify-content: space-between;
  box-shadow: 0 0 8px 0 rgba(0, 0, 0, 0.1);
  transition: all 0.2s ease;
}

.problem--card:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px 0 rgba(0, 0, 0, 0.1);
}

.problem--sidebar {
  display: flex;
  flex-direction: column;
  gap: 0.625rem;
}

.problem__header {
  font-size: 100%;
  font-weight: bold;
  flex-basis: 50px;
}

.problem__meta {
  display: flex;
  flex-direction: column;
  gap: 0.625rem;
  min-width: 5.625rem;
}

.problem-incidents {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.problem-incidents .ticket {
  border: 1px solid var(--shadow-color);
  border-radius: 8px;
  padding: 0.625rem;
  grid-template-columns: 1.875rem 5.625rem 12.5rem;
  grid-template-rows: 1fr 1.25rem;
  grid-template-areas:
    "assigned-to id employee"
    "assigned-to status description";
}

.problem-incidents .ticket__date {
  display: none;
}

.problem-incidents .ticket__sla {
  display: none;
}

.problem-incidents .ticket__service {
  display: none;
}

.problem-incidents .ticket__client {
  display: none;
}

.problems {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.problem-details {
  display: flex;
  flex-direction: column;
  gap: 0.625rem;
}

.problem-details__header {
  font-size: 1.25rem;
  color: var(--neutral-500);
}

@media (max-width: 768px) {
  .priority {
    padding: 0.125rem 0.5rem;
    height: 1.25rem;
    font-size: 0.7rem !important;
  }

  .problem {
    grid-template-columns: 1.875rem 1fr auto !important;
    grid-template-rows: auto auto auto !important;
    grid-template-areas:
      "assigned-to id status"
      "assigned-to service priority"
      "assigned-to description description" !important;
    column-gap: 0.5rem;
    row-gap: 0.3125rem;
    align-items: center;
  }

  .problem__client,
  .problem__sla {
    display: none;
  }

  .problem__assigned-to {
    grid-area: assigned-to;
    align-self: start;
    padding-top: 0.25rem;
  }

  .problem__id {
    grid-area: id;
    font-weight: 700;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .problem__status {
    grid-area: status;
    justify-self: end;
    text-align: right;
  }

  .problem__service {
    grid-area: service;
    font-size: 0.75rem;
    color: var(--neutral-500);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    min-width: 0;
  }

  .problem__priority {
    grid-area: priority;
    justify-self: end;
    text-align: right;
  }

  .problem__description {
    grid-area: description;
    min-width: 0;
    font-size: 0.875rem;
    line-height: 1.4;
    color: var(--neutral-700);
    margin-top: 0.25rem;
  }
  
  .problem__description--truncated {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    max-width: 100%;
    overflow: hidden;
  }
}
}
