body {
    background-color: #121212;
    font-family: "Inter", "Segoe UI", sans-serif;
    margin: 0;
    padding: 0;
}

#loginphp {
    overflow: hidden;
}

#login-container {
    height: 100vh;
    display: flex; 
    justify-content: center; 
    align-items: center; 
}

#login {
    background-color: #1E1E1E;
    border: 2px solid #292929;
    width: 500px;
    height: 500px;
    display: flex;
    justify-content: center;
    align-items: center;
    box-shadow: 0px 8px 20px rgba(0, 0, 0, 0.7);
    border-radius: 5px;
}

#login form {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
}

#login input,
#login button {
    display: block;
    width: 300px; 
    height: 40px; 
    margin-top: 20px;
    padding: 5px; 
    font-size: 14px;
    border: none; 
    border-radius: 5px; 
    box-sizing: border-box; 
}

#login input {
    background-color: #292929;
    padding: 10px;
    color: #fff;
}

#login input:focus {
    outline: none;
    border: 1px solid #6200EE;
}

#login button {
    background-color: #BB86FC;
    color: #121212;
    cursor: pointer; 
    transition: background-color 0.3s ease; 
}

#login button:hover {
    background-color: #9f68d0;
}

.icon {
    background-color: #BB86FC;
    border-radius: 50%;
    width: 70px; 
    height: 70px;
    font-size: 30px;
    display: flex; 
    justify-content: center;
    align-items: center;
    color: #121212;
}

#login h2 {
    color: white;
}

.message {
    font-size: 14px;
    margin-bottom: 15px;
    font-weight: bold;
    margin-left: auto;
    margin-right: auto;
    max-width: 350px;
    text-align: center;
}

.message.error {
    color: #FF5370;
}

.message.success {
    color: #03DAC6;
}

#sidebar {
    height: 100vh;
    width: 15%;
    background-color: #1E1E1E;
    border-right: 2px solid #292929;
    box-shadow: 0px 8px 20px rgba(0, 0, 0, 0.7);
    position: fixed;
    z-index: 100;
}

#items {
    padding-top: 200px;
}

.item {
    color: white;
    height: 50px;
    display: flex; 
    align-items: center;
    padding-left: 20px;
    gap: 10px;
    margin-bottom: 5px;
}

.item:hover,
.item.selected {
    background-color: rgba(50, 50, 50, 0.8);
}

.item:hover {
    cursor: pointer;
}

.item.selected,
.subitem.selected {
    border-right: 3px solid #BB86FC;
}

.item .fa {
    font-size: 25px;
}

.item * {
    display: inline;
}

.item h3 {
    font-weight: lighter;
    font-size: 18px;
    margin: 0; 
    line-height: 1; 
    position: absolute; 
    left: 70px;
}

#sidebar .submenu {
    display: none;
    padding-left: 20px;
    max-height: 0;
    overflow: hidden;
}

#sidebar .item:hover .submenu {
    display: block;
}

#sidebar .item.open {
    height: auto;
    align-items: flex-start;
    padding-top: 15px;
}

#sidebar .item.open .submenu {
    max-height: 500px; 
    display: block;
    padding-top: 30px;
    overflow-y: auto; 
}

#sidebar .subitem {
    font-size: 1em;
    padding: 10px 20px;
    display: flex;
    align-items: center;
    gap: 10px;
    padding-right: 200px;
}

#sidebar .subitem:hover,
#sidebar .subitem.selected {
    background-color: rgba(50, 50, 50, 0.8);
}

#sidebar .subitem h4 {
    margin: 0;
    font-weight: normal;
}

.toggle-icon {
    float: right;
    transition: transform 0.3s ease;
}

.item.open .toggle-icon {
    transform: rotate(90deg);
}

a {
    text-decoration: none;
    color: transparent;
    background: transparent;
    border: none;
    padding: 0;
}

a {
    color: inherit;
    text-decoration: none; 
}

a span {
    color: inherit; 
}

#content {
    margin-left: 15%;
    padding: 20px;
}

#content h1 {
    color: white;
}

table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 20px;
}

table, th, td {
    color: white;
    border: 1px solid #292929;
}

th, td {
    padding: 10px;
    text-align: left;
}

th {
    background-color: #1E1E1E;
    color: #BB86FC;
}

tr:nth-child(even) {
    background-color: #2E2E2E;
}

table tbody tr:hover {
    background-color: rgba(187, 134, 252, 0.1);
    cursor: pointer;
}

.rank-tag {
    padding: 5px 10px;
    border-radius: 5px;
    background-color: rgba(187, 134, 252, 0.1);
}

.pagination {
    text-align: center;
}

.pagination a {
    color: #BB86FC;
    padding: 8px 16px;
    text-decoration: none;
    border: 1px solid #292929;
    margin: 0 4px;
    border-radius: 5px;
}

.pagination a.active {
    background-color: #BB86FC;
    color: #121212;
}

form {
  margin-bottom: 20px;
}

form input[type="text"] {
  padding: 10px;
  border: 1px solid #292929;
  border-radius: 5px;
  background-color: #1E1E1E;
  color: #BB86FC;
}

form button {
  padding: 10px 20px;
  border: none;
  border-radius: 5px;
  background-color: #BB86FC;
  color: #121212;
  cursor: pointer;
  transition: background-color 0.3s ease;
}

form button:hover {
  background-color: #9f68d0;
}

search-container {
  display: flex;
  align-items: center;
  width: 100%;
  position: relative;
}

.search-container input[type="text"] {
  flex: 1;
  padding: 10px 40px 10px 10px;
  border: 1px solid #292929;
  border-radius: 5px;
  background-color: #1E1E1E;
  color: #BB86FC;
  font-size: 16px;
  width: 100%; 
}

search-container input[type="text"]:focus {
  outline: none;
  border: 1px solid #6200EE;
}

.search-container .search-icon {
  position: absolute;
  right: 10px;
  color: #BB86FC;
  font-size: 16px;
}

.back-button,
.edit-button {
    display: inline-block;
    padding: 10px 20px;
    margin-bottom: 20px;
    background-color: #BB86FC;
    color: #121212;
    text-decoration: none;
    border-radius: 5px;
    transition: background-color 0.3s ease;
    max-height: 50px;
}

.back-button:hover,
.edit-button:hover {
    background-color: #9f68d0;
}

#property-container {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
}

.card {
    background-color: #1E1E1E;
    border: 1px solid #292929;
    border-radius: 10px;
    box-shadow: 0px 4px 8px rgba(0, 0, 0, 0.2);
    padding: 20px;
    width: calc(50% - 10px); 
    box-sizing: border-box;
    color: #E0E0E0;;
    min-width: calc(50% - 10px);
    flex: 1;
    display: flex;
    flex-direction: column; 
    box-sizing: border-box; 
}

.card.char-details {
    max-height: 600px;
}

.card h2 {
    margin-top: 0;
    color: #BB86FC;
}

.card-content {
    max-height: 350px; 
    overflow-y: auto; 
    flex: 1; 
}

.card-content.char-content {
    max-height: 500px;
}

.card-content::-webkit-scrollbar {
    width: 8px;
}

.card-content::-webkit-scrollbar-thumb {
    background-color: #BB86FC;
    border-radius: 10px;
}

.card-content::-webkit-scrollbar-track {
    background-color: #1E1E1E;
}

.header-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.header-buttons {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

.header-buttons .edit-button,
.header-buttons .back-button,
.header-buttons .add-button {
    margin-left: 10px;
}

.info-row {
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
}

.info-row p {
    flex: 1 1 calc(50% - 10px);
    margin: 5px;
    word-break: break-word; 
}

.company-link,
.task-notes a,
.link {
    color: #BB86FC;
    text-decoration: none;
    transition: color 0.3s ease;
}

.company-link:hover,
.link:hover {
    color: #9f68d0;
}

table {
    width: 100%;
    border-collapse: collapse;
}

table th {
    background-color: #1e1e1e;
    padding: 10px;
    text-align: left;
}

.card table th {
    background-color: #2E2E2E;
}

table td {
    padding: 10px;
    border-bottom: 1px solid #292929;
}

#char-container,
#company-container {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
}

.overflow-wrap {
    word-break: break-word;
    overflow-wrap: break-word;
}

.popup {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    margin: 0;
    background-color: rgba(0, 0, 0, 0.5);
}

.popup-content {
    background-color: #1E1E1E;
    padding: 20px;
    border: 1px solid #292929;
    width: 80%;
    max-width: 500px;
    border-radius: 10px;
    box-shadow: 0px 4px 8px rgba(0, 0, 0, 0.2);
    color: #E0E0E0;
    margin: 100px auto; 
}

#editTaskPopup .popup-content,
#createTaskPopup .popup-content {
    margin: 50px auto; 
}

.popup-content input[type="text"],
.popup-content input[type="color"],
.popup-content input[type="number"],
.popup-content input[type="password"],
.popup-content input[type="date"],
.popup-content textarea,
.popup-content select,
.popup-content button {
    width: calc(100% - 20px);
    padding: 10px;
    margin: 10px 0;
    border: 1px solid #292929;
    border-radius: 5px;
    background-color: #1E1E1E;
    color: #BB86FC;
}

.popup-content input[type="text"]:focus,
.popup-content input[type="number"]:focus,
.popup-content input[type="password"]:focus,
.popup-content input[type="date"]:focus,
.popup-content textarea:focus,
.popup-content select:focus {
    outline: none;
    border: 1px solid #6200EE;
}

.popup-content textarea {
    height: 100px;
    resize: vertical;
}

.popup-content button {
    padding: 10px 20px;
    border: none;
    border-radius: 5px;
    background-color: #BB86FC;
    color: #121212;
    cursor: pointer;
    transition: background-color 0.3s ease;
    display: block;
    margin: 20px auto; 
}

.popup-content button:hover {
    background-color: #9f68d0;
}

.popup .close {
    color: #BB86FC;
    float: right;
    font-size: 28px;
    font-weight: bold;
}

.popup .close:hover,
.popup .close:focus {
    color: #9f68d0;
    text-decoration: none;
    cursor: pointer;
}

.edit-button {
    padding: 10px;
    margin: 0;
}

th.actions-column {
    width: 700px;
}

td.actions-cell {
    display: flex;
    flex-direction: row; 
    align-items: center; 
    justify-content: center;
    gap: 10px; 
    height: 100%; 
}

.add-button {
    background-color: #4CAF50;
    color: white;
    border: none;
    padding: 10px 20px;
    cursor: pointer;
    float: right;
    border-radius: 5px;
    transition: background-color 0.3s ease;
    text-align: center;
}

select {
    width: 100%;
    padding: 10px;
    margin: 10px 0;
    border: 1px solid #292929;
    border-radius: 5px;
    background-color: #1E1E1E;
    color: #BB86FC;
    font-size: 16px;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-image: url('data:image/svg+xml;charset=US-ASCII,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 4 5"><path fill="%23BB86FC" d="M2 0L0 2h4zm0 5L0 3h4z"/></svg>');
    background-repeat: no-repeat;
    background-position: right 10px top 50%;
    background-size: 10px 10px;
}

select:focus {
    outline: none;
    border: 1px solid #6200EE;
}

option {
    background-color: #1E1E1E;
    color: #BB86FC;
}

.char-action {
    display: flex;
    gap: 10px;
}

.flex-container {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    align-items: stretch; 
}

.flex-item {
    flex: 1;
    max-width: calc(50% - 10px);
    display: flex;
    flex-direction: column; 
    box-sizing: border-box; 
}

#header {
    display: flex;
    justify-content:space-between;
    margin-bottom: 20px;
}

.tag {
    display: inline-block;
    padding: 0.25em 0.5em;
    font-size: 0.875em;
    font-weight: 600;
    color: #fff;
    background-color: #007bff;
    border-radius: 0.25em;
}

.tag[status="In Bearbeitung"] {
    background-color: #ffcf3e;
}

.tag[status="Unbearbeitet"] {
    background-color: #424242;
}

.tag[status="Abgelehnt"] {
    background-color: #ca2020;
}

.tag[status="Review benötigt"] {
    background-color: #17a2b8;
}

.tag[status="Abgeschlossen"] {
    background-color: #569c67;
}

.tag[priority="Niedrig"] {
    background-color: #6c757d;
}

.tag[priority="Mittel"] {
    background-color: #007bff;
}

.tag[priority="Hoch"] {
    background-color: #dc3545;
}

.tag[priority="Kritisch"] {
    background-color: #69000b;
}

.tag[status="Hilfe benötigt"] {
    background-color: #31d6ff;
}

.tag[status="Review benötigt"] {
    background-color: #73e3ff;
}

.tag[status="Implementiert"] {
    background-color: #28a745;
}

.tag[status="Online"] {
    background-color: #28a745;
}

.tag[status="Offline"] {
    background-color: #dc3545;
}

td[style="color: red;"] {
    color: red !important;
}

.card.flex-item.tasks {
    flex: 1 1 100%;
    max-width: 100%;
    height: auto;
}


.card.flex-item.tasks.no-max-height {
    max-height: none;
}

.card-content.tasks-content.no-max-height {
    max-height: none;
    overflow-y: visible;
}

.tasks .card-content {
    max-height: none;
}

.overview-container {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
}

.index-card {
    background-color: #1E1E1E;
    border: 1px solid #292929;
    border-radius: 10px;
    box-shadow: 0px 4px 8px rgba(0, 0, 0, 0.2);
    padding: 20px;
    width: calc(33% - 10px);
    box-sizing: border-box;
    color: #E0E0E0;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    height: 175px;
}

.index-card h2 {
    margin-top: 0;
    color: #BB86FC;
}
.index-card p {
    font-size: 1.2em;
    margin: 10px 0;
}

.index-card i {
    font-size: 25px;
    margin-right: 20px;
}

/* Player-Details dynamisch anpassen */
#player-container {
    display: flex;
    flex-wrap: nowrap;
    gap: 20px;
    align-items: stretch; /* Beide Spalten gleich hoch machen */
    width: 100%;
}

#player-details {
    flex: 0 0 20%; /* Fixiere die Breite auf 20% */
    max-width: 20%;
    min-width: 20%;
    height: auto; /* Entferne feste Höhen */
    display: flex;
    flex-direction: column; /* Inhalt vertikal anordnen */
    justify-content: flex-start; /* Inhalt gleichmäßig verteilen */
}

#right-column {
    flex: 1 1 calc(80% - 20px); /* Nimmt den restlichen Platz ein */
    display: flex;
    flex-direction: column;
    gap: 20px;
    width: calc(80% - 20px);
}

#actions {
    flex: 1 1 auto; 
    width: 100%; 
    max-width: 100%;
}

.char-card {
    flex: 1 1 auto; 
    width: 100%;
    max-width: 100%; 
    max-height: 500px;
    overflow-y: auto; 
}

#player-details .card-content {
    max-height: 700px;
    overflow-y: auto;
}

#player-details img {
    display: block;
    margin: 0 auto 20px;
    border-radius: 10px;
}

#player-details .info-row {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

#player-details .info-row p {
    margin: 5px 0;
    text-align: center;
}

.char-action {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

#login-chart {
    flex: 1 1 auto;
    width: 100%;
    max-width: 100%;
    padding: 20px;
}

#login-chart canvas {
    max-width: 100%;
    height: auto;
}

.chart-info {
    margin-top: 20px;
    color: #BB86FC;
    font-size: 14px;
    text-align: center;
}

.chart-container {
    display: flex;
    flex-wrap: nowrap;
    align-items: flex-start;
    justify-content: space-evenly;
}

.chart-table {
    flex: 0 0 30%; 
    max-width: 30%;
    max-height: 300px; 
    overflow-y: auto; 
}


.chart-table table {
    width: 100%;
    border-collapse: collapse;
    color: #E0E0E0;
    font-size: 14px;
}

.chart-table th, .chart-table td {
    padding: 8px;
    text-align: left;
    border: 1px solid #292929;
}

.chart-table th {
    background-color: #1E1E1E;
    color: #BB86FC;
}

.chart-table tr:nth-child(even) {
    background-color: #2E2E2E;
}

.chart-table tr:hover {
    background-color: rgba(187, 134, 252, 0.1);
}

.chart-table::-webkit-scrollbar {
    width: 8px;
}

.chart-table::-webkit-scrollbar-thumb {
    background-color: #BB86FC;
    border-radius: 10px;
}

.chart-table::-webkit-scrollbar-track {
    background-color: #1E1E1E;
}

/* Cases Styles */
.cases-overview {
    display: flex;
    gap: 20px;
    margin-bottom: 40px;
}

.case-summary-card {
    flex: 1;
    background: linear-gradient(135deg, #1E1E1E 0%, #2E2E2E 100%);
    border: 2px solid #BB86FC;
    border-radius: 15px;
    padding: 30px;
    display: flex;
    align-items: center;
    gap: 20px;
    box-shadow: 0px 8px 20px rgba(187, 134, 252, 0.2);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.case-summary-card:hover {
    transform: translateY(-5px);
    box-shadow: 0px 12px 30px rgba(187, 134, 252, 0.4);
}

.case-summary-card.my-cases {
    border-color: #03DAC6;
    box-shadow: 0px 8px 20px rgba(3, 218, 198, 0.2);
}

.case-summary-card.my-cases:hover {
    box-shadow: 0px 12px 30px rgba(3, 218, 198, 0.4);
}

.case-summary-icon {
    font-size: 60px;
    color: #BB86FC;
    width: 80px;
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(187, 134, 252, 0.1);
    border-radius: 50%;
}

.case-summary-card.my-cases .case-summary-icon {
    color: #03DAC6;
    background: rgba(3, 218, 198, 0.1);
}

.case-summary-content {
    flex: 1;
}

.case-summary-content h2 {
    font-size: 48px;
    margin: 0;
    color: #BB86FC;
    font-weight: bold;
}

.case-summary-card.my-cases .case-summary-content h2 {
    color: #03DAC6;
}

.case-summary-content p {
    margin: 10px 0;
    color: #E0E0E0;
    font-size: 18px;
}

.cases-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.case-category-card {
    background-color: #1E1E1E;
    border: 1px solid #292929;
    border-radius: 10px;
    padding: 20px;
    box-shadow: 0px 4px 8px rgba(0, 0, 0, 0.2);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.case-category-card:hover {
    transform: translateY(-3px);
    box-shadow: 0px 8px 16px rgba(187, 134, 252, 0.3);
    border-color: #BB86FC;
}

.case-category-card h3 {
    color: #BB86FC;
    margin: 0 0 20px 0;
    font-size: 20px;
    border-bottom: 2px solid #292929;
    padding-bottom: 10px;
}

.case-stats {
    display: flex;
    justify-content: space-around;
    margin: 20px 0;
}

.case-stat {
    text-align: center;
}

.case-stat .stat-number {
    display: block;
    font-size: 36px;
    font-weight: bold;
    color: #BB86FC;
}

.case-stat .stat-label {
    display: block;
    color: #E0E0E0;
    font-size: 14px;
    margin-top: 5px;
}

.case-actions {
    margin: 20px 0;
}

.case-button {
    display: inline-block;
    padding: 10px 20px;
    background-color: #BB86FC;
    color: #121212;
    text-decoration: none;
    border-radius: 5px;
    transition: background-color 0.3s ease;
    border: none;
    cursor: pointer;
    font-size: 16px;
    width: 100%;
    text-align: center;
}

.case-button:hover {
    background-color: #9f68d0;
}

.case-button.small {
    padding: 8px 15px;
    font-size: 14px;
}

.case-button i {
    margin-right: 5px;
}

.case-permissions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 15px;
}

.perm-badge {
    display: inline-block;
    padding: 5px 10px;
    border-radius: 5px;
    font-size: 12px;
    font-weight: bold;
}

.perm-badge.edit {
    background-color: rgba(255, 193, 7, 0.2);
    color: #FFC107;
    border: 1px solid #FFC107;
}

.perm-badge.complete {
    background-color: rgba(76, 175, 80, 0.2);
    color: #4CAF50;
    border: 1px solid #4CAF50;
}

#case-detail-container {
    display: flex;
    gap: 20px;
    width: 100%;
    align-items: flex-start;
}

/* Karten im Case-Detail sollen volle Spaltenbreite einnehmen */
#case-detail-container .card {
    width: 100% !important;
    min-width: 0 !important;
}

.case-detail-left {
    flex: 0 0 40%;
    min-width: 360px;
    max-width: 600px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.case-detail-right {
    flex: 1 1 auto;
    min-width: 0;
    position: sticky;
    top: 20px;
    height: calc(100vh - 40px);
    max-height: calc(100vh - 40px);
    display: flex;
    flex-direction: column;
}

.case-info p {
    margin: 10px 0;
    color: #E0E0E0;
}

.case-actions-panel {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #292929;
    clear: both;
    overflow: hidden;
}

.case-actions-panel h3 {
    color: #BB86FC;
    margin-bottom: 15px;
    margin-top: 0;
}

.case-actions-panel button {
    width: 100%;
    margin-bottom: 15px;
    display: block;
    box-sizing: border-box;
}

.case-status-select {
    width: 100%;
    margin: 10px 0 15px 0;
    display: block;
    box-sizing: border-box;
}

.case-details-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
}

.case-details-grid p {
    margin: 5px 0;
    color: #E0E0E0;
}

/* Chat Styles */
.case-chat-card {
    display: flex;
    flex-direction: column;
    height: 100%;
    max-height: 100%;
}

.case-chat-card h2 {
    margin-bottom: 10px;
    flex-shrink: 0;
}

.case-chat-messages {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    padding: 15px;
    background-color: #121212;
    border: 1px solid #292929;
    border-radius: 5px;
    margin: 10px 0;
}

.chat-message {
    margin-bottom: 15px;
    padding: 10px;
    border-radius: 8px;
    background-color: #1E1E1E;
}

.chat-message.staff {
    background-color: rgba(187, 134, 252, 0.1);
    border-left: 3px solid #BB86FC;
}

.chat-message.user {
    background-color: rgba(3, 218, 198, 0.1);
    border-left: 3px solid #03DAC6;
}

.chat-message-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.chat-message-header strong {
    color: #BB86FC;
}

.chat-message.user .chat-message-header strong {
    color: #03DAC6;
}

.chat-timestamp {
    font-size: 12px;
    color: #888;
}

.chat-message-content {
    color: #E0E0E0;
    line-height: 1.5;
}

.case-chat-input {
    margin-top: auto;
    padding-top: 10px;
    flex-shrink: 0;
    background-color: #1A1A1A;
}

.case-chat-input textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid #292929;
    border-radius: 5px;
    background-color: #1E1E1E;
    color: #E0E0E0;
    resize: none;
    font-family: inherit;
    margin-bottom: 10px;
    box-sizing: border-box;
    min-height: 60px;
}

.case-chat-input button {
    box-sizing: border-box;
    width: 100%;
}

.case-chat-input textarea:focus {
    outline: none;
    border-color: #BB86FC;
}

.case-chat-messages::-webkit-scrollbar {
    width: 8px;
}

.case-chat-messages::-webkit-scrollbar-thumb {
    background-color: #BB86FC;
    border-radius: 10px;
}

.case-chat-messages::-webkit-scrollbar-track {
    background-color: #1E1E1E;
}

/* Permissions Display in Popup - Grid Layout */
#permissionsContainer,
#newRankPermissionsContainer {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
    max-height: 500px;
    overflow-y: auto;
    padding: 10px;
    background-color: #121212;
    border: 1px solid #292929;
    border-radius: 5px;
    margin: 15px 0;
}

#permissionsContainer label,
#newRankPermissionsContainer label {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 8px;
    background-color: #1E1E1E;
    border: 1px solid #292929;
    border-radius: 5px;
    color: #E0E0E0;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 12px;
}

#permissionsContainer label:hover,
#newRankPermissionsContainer label:hover {
    background-color: #2E2E2E;
    border-color: #BB86FC;
}

#permissionsContainer input[type="checkbox"],
#newRankPermissionsContainer input[type="checkbox"] {
    width: 16px;
    height: 16px;
    cursor: pointer;
    flex-shrink: 0;
}

#permissionsContainer label span,
#newRankPermissionsContainer label span {
    font-size: 11px;
    word-break: break-word;
    line-height: 1.2;
}

#permissionsContainer::-webkit-scrollbar,
#newRankPermissionsContainer::-webkit-scrollbar {
    width: 8px;
}

#permissionsContainer::-webkit-scrollbar-thumb,
#newRankPermissionsContainer::-webkit-scrollbar-thumb {
    background-color: #BB86FC;
    border-radius: 10px;
}

#permissionsContainer::-webkit-scrollbar-track,
#newRankPermissionsContainer::-webkit-scrollbar-track {
    background-color: #1E1E1E;
}

/* Responsive für Permissions */
@media (max-width: 1400px) {
    #permissionsContainer,
    #newRankPermissionsContainer {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 1000px) {
    #permissionsContainer,
    #newRankPermissionsContainer {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 600px) {
    #permissionsContainer,
    #newRankPermissionsContainer {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 1200px) {
    .case-detail-left {
        flex: 0 0 45%;
        min-width: 320px;
    }
}

@media (max-width: 768px) {
    .cases-overview {
        flex-direction: column;
    }
    
    #case-detail-container {
        flex-direction: column;
    }
    
    .case-detail-right {
        flex: 1;
        min-width: 100%;
        max-width: 100%;
        position: static;
    }
    
    .case-detail-left {
        width: 100%;
    }
}

/* --- Fix: Buttons/Links sollen nicht über Rahmen hinausragen --- */
.back-button,
.edit-button {
    box-sizing: border-box;
    max-width: 100%;
}

.case-button,
.add-button {
    box-sizing: border-box;
    max-width: 100%;
}

td.actions-cell {
    flex-wrap: wrap;
}

.case-summary-content .case-button,
.case-actions .case-button,
.header-buttons .back-button,
table .edit-button,
.card .case-button,
.card .back-button,
.card .edit-button {
    display: block;
    max-width: 100%;
    box-sizing: border-box;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}