.roles-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1.5rem;
    max-height: calc(100vh - 150px); /* Adjust based on your header height */
    overflow-y: auto;
    padding: 1rem;
}


.role-card {
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 12px;
    padding: 1rem;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
    transition: transform .2s ease;
}

.role-card:hover {
    transform: translateY(-3px);
}

.role-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.8rem;
}

.role-card h2 {
    font-size: 1.2rem;
    color: #333;
}

.edit-btn {
    background-color: #4CAF50;
    color: #fff;
    padding: 0.3rem 0.6rem;
    border-radius: 6px;
    text-decoration: none;
    font-size: 0.85rem;
    transition: background-color 0.2s ease;
}

.edit-btn:hover {
    background-color: #45a049;
}

.permission-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.permission-list li {
    background: #f5f5f5;
    margin-bottom: .4rem;
    padding: .4rem .6rem;
    border-radius: 6px;
    font-size: .9rem;
}

.no-permission {
    color: #999;
    font-style: italic;
}

.role-form {
    max-width: 900px;
    margin: 2rem auto;
    padding: 1rem;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    font-weight: bold;
    display: block;
    margin-bottom: 0.5rem;
}

.form-group input[type="text"] {
    width: 100%;
    padding: 0.5rem 0.7rem;
    border: 1px solid #ccc;
    border-radius: 8px;
    font-size: 1rem;
}

.permissions-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    max-height: 400px; /* scroll if too many permissions */
    overflow-y: auto;
    padding: 0.5rem;
    border: 1px solid #eee;
    border-radius: 8px;
    background: #fafafa;
}

.permission-badge {
    display: flex;
    align-items: center;
    background: #f0f4f8;
    padding: 0.3rem 0.6rem;
    border-radius: 12px;
    font-size: 0.85rem;
    white-space: nowrap;
}

.permission-badge input[type="checkbox"] {
    margin-right: 0.4rem;
    transform: scale(1.1);
}

.btn-submit {
    background-color: #4CAF50;
    color: white;
    padding: 0.5rem 1.2rem;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    cursor: pointer;
    transition: background-color 0.2s;
}

.btn-submit:hover {
    background-color: #45a049;
}

.error {
    color: #f44336;
    font-size: 0.85rem;
    margin-top: 0.3rem;
}
.role-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.8rem;
}

.role-actions {
    display: flex;
    gap: 0.5rem;
}

.edit-btn, .delete-btn {
    padding: 0.3rem 0.6rem;
    border-radius: 6px;
    font-size: 0.85rem;
    text-decoration: none;
    cursor: pointer;
    border: none;
}

.edit-btn {
    background-color: #4CAF50;
    color: #fff;
}

.edit-btn:hover {
    background-color: #45a049;
}

.delete-btn {
    background-color: #f44336;
    color: #fff;
}

.delete-btn:hover {
    background-color: #d32f2f;
}
/* Modal backdrop */
.modal {
    display: none; /* hidden by default */
    position: fixed;
    z-index: 999;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(2px);
    padding: 1rem;
    box-sizing: border-box;
}

/* Modal content box */
.modal-content {
    background-color: #fff;
    margin: 5% auto;
    padding: 2rem;
    border-radius: 12px;
    max-width: 500px;
    width: 100%;
    text-align: center;
    box-shadow: 0 8px 20px rgba(0,0,0,0.25);
    animation: slideDown 0.3s ease-out;
}

/* Modal slide down animation */
@keyframes slideDown {
    from { transform: translateY(-50px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

/* Close button */
.close-btn {
    position: absolute;
    top: 0.5rem;
    right: 1rem;
    font-size: 1.8rem;
    cursor: pointer;
    color: #333;
}

/* Modal heading */
.modal-content h3 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
}

/* Modal text */
.modal-content p {
    font-size: 1rem;
    margin-bottom: 2rem;
    color: #555;
}

/* Buttons */
.modal .delete-btn,
.modal .cancel-btn {
    padding: 0.6rem 1.2rem;
    border-radius: 8px;
    font-size: 1rem;
    border: none;
    cursor: pointer;
    margin: 0 0.3rem;
    transition: all 0.2s;
}

.modal .delete-btn {
    background-color: #f44336;
    color: #fff;
}

.modal .delete-btn:hover {
    background-color: #d32f2f;
}

.modal .cancel-btn {
    background-color: #e0e0e0;
    color: #333;
}

.modal .cancel-btn:hover {
    background-color: #ccc;
}

/* Responsive for mobile */
@media (max-width: 480px) {
    .modal-content {
        padding: 1.5rem;
    }

    .modal-content h3 {
        font-size: 1.3rem;
    }

    .modal-content p {
        font-size: 0.95rem;
    }

    .modal .delete-btn,
    .modal .cancel-btn {
        font-size: 0.95rem;
        padding: 0.5rem 1rem;
    }
}

.multi-select-container {
    position: relative;
    width: 100%;
}

.multi-select-container input[type="text"] {
    width: 100%;
    padding: 0.5rem;
    border-radius: 6px;
    border: 1px solid #ccc;
}

.multi-select-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    max-height: 250px;
    overflow-y: auto;
    border: 1px solid #ccc;
    background: #fff;
    z-index: 1000;
    display: none;
    border-radius: 6px;
    padding: 0.5rem;
}

.multi-select-dropdown label {
    display: block;
    padding: 0.3rem 0.5rem;
    cursor: pointer;
    border-radius: 4px;
}

.multi-select-dropdown label:hover {
    background-color: #f0f0f0;
}

/* Level-specific colors and styles */
.multi-select-dropdown .level-0 {
    font-weight: bold;
    background-color: #f9f9f9;
}

.multi-select-dropdown .level-1 {
    background-color: #fdfdfd;
}

.multi-select-dropdown .level-2 {
    background-color: #ffffff;
    color: #555;
}

.multi-select-dropdown .level-3 {
    background-color: #ffffff;
    color: #777;
    font-style: italic;
}



/* Table wrapper for scrolling */
.table-containern {
    width: 100%;
    overflow-x: auto;  /* horizontal scroll */
    border: 1px solid #ccc;
    border-radius: 8px;
}

/* Table styles */
.im-tablen {
    width: 100%;
    border-collapse: collapse;
    min-width: 600px; /* force horizontal scroll if screen too small */
}

.im-tablen th, .im-tablen td {
    padding: 0.5rem 0.75rem;
    border-bottom: 1px solid #e5e5e5;
    text-align: left;
    white-space: nowrap;
}

/* Striped rows */
.im-tablen tbody tr:nth-child(even) {
    background-color: #fafafa;
}

.im-tablen tbody tr:hover {
    background-color: #f1f7ff;
}

/* Small action buttons */
.actions-column {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem;
    justify-content: flex-start;
    align-items: center;
}

.im-btnn {
    padding: 0.25rem 0.5rem;
    font-size: 0.75rem;
    border-radius: 4px;
    border: none;
    cursor: pointer;
    white-space: nowrap;
}

.im-btn-viewn {
    background-color: #3498db;
    color: #fff;
}

.im-btn-editn {
    background-color: #f1c40f;
    color: #333;
}

.im-btn-deleten {
    background-color: #e74c3c;
    color: #fff;
}

.inline-form {
    display: inline;
}

/* Responsive: stack buttons on very small screens */
@media (max-width: 500px) {
    .actions-column {
        flex-direction: column;
        align-items: flex-start;
    }
    .im-btn {
        width: 100%;
        text-align: center;
    }
}

.cards-wrapper {
    display: flex;
    justify-content: center;  /* horizontal centering */
    /* do NOT set align-items: center here, so it won't vertically center */
    /* optional margin or padding if you want some space from top */
    margin-top: 0;  /* ensures no extra space from top */
    padding-top: 0; /* ensure wrapper doesn't add top padding */
}

/* Card styling */
.building-card {
    background-color: #fff;
    border: 1px solid #ddd;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    padding: 1rem 1.5rem;
    margin: 1rem 0;
    max-width: 600px;
    /* optional: make all cards same width in a grid container */
}

.building-title {
    font-size: 1.5rem;
    margin-bottom: 0.75rem;
    color: #333;
}

.building-title .building-code {
    font-size: 1rem;
    color: #777;
    margin-left: 0.5rem;
}

.building-info {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 0.5rem 1rem;
    margin-bottom: 1rem;
}

.info-item .label {
    font-weight: bold;
    color: #555;
}

.building-relations, .building-topics {
    margin-bottom: 1rem;
}

.relation, .building-topics {
    border-top: 1px solid #eee;
    padding-top: 0.75rem;
}

.relation h3, .building-topics h3 {
    font-size: 1.2rem;
    margin-bottom: 0.5rem;
    color: #444;
}

.relation-list, .topic-list {
    list-style: none;
    padding-left: 0;
}

.relation-item, .topic-item {
    padding: 0.25rem 0;
    color: #555;
}

.topic-label {
    font-weight: 500;
}

.topic-code, .topic-class {
    margin-left: 0.5rem;
    color: #666;
}

.attachment {
    margin-left: 0.5rem;
    text-decoration: none;
    color: #007BFF;
}

.attachment:hover {
    text-decoration: underline;
}

/* Responsive adjustments */
@media (max-width: 600px) {
    .building-info {
        grid-template-columns: 1fr;
    }
}

.info-item {
    background: #f7f9fc;
    padding: 0.5rem 0.75rem;
    border-radius: 6px;
    font-size: 0.95rem;
}
.label {
    font-weight: 600;
    color: #34495e;
}

/* Relations */
.building-relations {
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
}

.relation {
    flex: 1 1 300px;
}
.relation h3 {
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
    color: #34495e;
}
.relation-list {
    list-style: none;
    margin: 0;
    padding-left: 0;
}
.relation-list li {
    padding: 0.3rem 0.5rem;
    margin-bottom: 0.25rem;
    border-left: 3px solid transparent;
    transition: border-color 0.2s;
}
.relation-list li .code {
    color: #7f8c8d;
    font-size: 0.9rem;
}

/* Color levels for hierarchy */
.relation-list li.level-0 { border-left-color: #3498db; padding-left: 0.5rem; }
.relation-list li.level-1 { border-left-color: #2ecc71; padding-left: 1.5rem; }
.relation-list li.level-2 { border-left-color: #f1c40f; padding-left: 2.5rem; }
.relation-list li.level-3 { border-left-color: #e67e22; padding-left: 3.5rem; }

/* No relation */
.no-relation {
    font-style: italic;
    color: #95a5a6;
}

.im-btn-add-property {
    background-color: #adb5bd; /* light gray */
    color: #fff;
    padding: 6px 12px;
    border-radius: 8px;
    text-decoration: none;
    margin: 0 4px;
    display: inline-flex;
    align-items: center;
    gap: 6px; /* space between icon and text */
    font-weight: 500;
    transition: background-color 0.2s ease-in-out;
}

.im-btn-add-property:hover {
    background-color: #909ca4; /* slightly darker gray on hover */
}


/* Container */
.options-container {
    display: none;
    margin-top: 10px;
}

/* Label */
.options-label {
    font-weight: 600;
    display: block;
    margin-bottom: 5px;
    color: #333;
}

/* Option item */
.options-list .option-item {
    display: flex;
    align-items: center;
    margin-bottom: 5px;
}

/* Option input */
.option-input {
    flex: 1;
    padding: 6px 10px;
    border: 1px solid #ccc;
    border-radius: 4px;
    margin-right: 5px;
}

/* Remove button */
.btn-remove-option {
    background-color: #dc3545;
    color: #fff;
    border: none;
    padding: 4px 8px;
    border-radius: 4px;
    cursor: pointer;
}

/* Add option button */
.btn-add-option {
    background-color: #6c757d;
    color: #fff;
    border: none;
    padding: 6px 12px;
    border-radius: 4px;
    cursor: pointer;
}

.im-login-success-msg {
    background-color: #d4edda;      /* Light green background */
    color: #155724;                 /* Dark green text */
    border: 1px solid #c3e6cb;     /* Green border */
    padding: 12px 20px;             /* Add padding */
    border-radius: 6px;             /* Rounded corners */
    font-size: 0.95rem;             /* Slightly smaller text */
    font-weight: 600;               /* Bold text */
    margin-bottom: 15px;            /* Space below */
    box-shadow: 0 2px 5px rgba(0,0,0,0.1); /* Subtle shadow */
    display: flex;
    align-items: center;
    gap: 10px;                      /* Space between icon and text */
}

.im-login-success-msg {
    background-color: #d4edda;      /* Light green background */
    color: #155724;                 /* Dark green text */
    border: 1px solid #c3e6cb;     /* Green border */
    padding: 12px 20px;             /* Add padding */
    border-radius: 6px;             /* Rounded corners */
    font-size: 0.95rem;             /* Slightly smaller text */
    font-weight: 600;               /* Bold text */
    margin-bottom: 15px;            /* Space below */
    box-shadow: 0 2px 5px rgba(0,0,0,0.1); /* Subtle shadow */
    display: flex;
    align-items: center;
    gap: 10px;                      /* Space between icon and text */
}
.im-login-error-msg {
    background-color: #f8d7da;       /* Light red/pink background */
    color: #721c24;                  /* Dark red text */
    border: 1px solid #f5c6cb;      /* Red border */
    padding: 12px 20px;              /* Add padding */
    border-radius: 6px;              /* Rounded corners */
    font-size: 0.95rem;              /* Slightly smaller text */
    font-weight: 600;                /* Bold text */
    margin-bottom: 15px;             /* Space below */
    box-shadow: 0 2px 5px rgba(0,0,0,0.1); /* Subtle shadow */
    display: flex;
    align-items: center;
    gap: 10px;                       /* Space between icon and text */
}
.upload-container {
    position: relative;
}
.upload-container input {
    border: 1px solid #92b0b3;
    background: #f1f1f1;
    outline: 2px dashed #92b0b3;
    outline-offset: -10px;
    padding: 100px 0px 100px 250px;
    text-align: center !important;
    width: 500px;
}

.upload-container input:hover {
    background: #ddd;
}

.upload-container:before {
    position: absolute;
    bottom: 50px;
    left: 245px;
    content: "";
    color: #3f8188;
    font-weight: 900;
}

.upload-btn {
    margin-left: 300px;
    padding: 7px 20px;
}
.file-list-container {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-top: 5px;
    max-height: 200px;
    overflow-y: auto;
}

.file-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 12px;
    background-color: #f4f4f4;
    border-radius: 4px;
    border: 1px solid rgba(0,0,0,0.1);
    font-size: 0.95em;
}

.file-item span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 80%;
}

.file-item button.remove-file-btn {
    border: none;
    background: transparent;
    color: #c00;
    font-size: 1.1em;
    cursor: pointer;
}

.file-item button.remove-file-btn:hover {
    color: #900;
    transform: scale(1.2);
}
.attachment-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 10px;
}

.attachment-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 12px;
    background-color: #f4f4f4;
    border-radius: 4px;
    border: 1px solid rgba(0,0,0,0.1);
}

.attachment-item a {
    text-decoration: none;
    color: #333;
}

.remove-file-btn {
    border: none;
    background: transparent;
    color: #c00;
    font-size: 1.1em;
    cursor: pointer;
}

.remove-file-btn:hover {
    color: #900;
    transform: scale(1.2);
}
.upload-area {
    border: 2px dashed #3f8188;
    padding: 50px;
    text-align: center;
    cursor: pointer;
}
/* -----------------------------------------
   Global error message box
   Displays all validation messages together
------------------------------------------ */
.error-box {
    background-color: #fdecea;   /* soft red background */
    border: 1px solid #f5c2c0;   /* subtle border */
    color: #b71c1c;              /* deep readable red */
    padding: 12px 16px;
    border-radius: 6px;
    margin-bottom: 16px;
    font-family: "Inter", "Segoe UI", Arial, sans-serif;
    max-width: 600px;            /* prevent stretching on large screens */
    width: 100%;
    box-sizing: border-box;
}

.error-box h4 {
    margin: 0 0 8px;
    font-size: 1rem;
    font-weight: 600;
}

.error-box ul {
    margin: 0;
    padding-left: 20px;
}

.error-box li {
    font-size: 0.9rem;
    margin-bottom: 4px;
}

/* ✅ Responsive tweaks for mobile */
@media (max-width: 480px) {
    .error-box {
        font-size: 0.85rem;
        padding: 10px 12px;
    }
}
.systembenutzer.hidden {
    display: none;
}

.history-card {
    background: #fff;
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);

    max-height: 80vh; /* default for desktop */
    overflow-y: auto;
}
.history-card h3 {
    margin-bottom: 1rem;
    font-size: 1.6rem;
    color: #222;
}

.no-history {
    font-style: italic;
    color: #777;
}

/* Timeline */
.history-timeline {
    position: relative;
    list-style: none;
    padding-left: 2rem;
    margin: 0;
}

.history-timeline::before {
    content: '';
    position: absolute;
    top: 0;
    left: 10px;
    width: 2px;
    height: 100%;
    background: #ddd;
}

.timeline-item {
    position: relative;
    margin-bottom: 1.5rem;
    padding-left: 1rem;
}

.timeline-dot {
    position: absolute;
    left: 0;
    top: 0.6rem;
    width: 12px;
    height: 12px;
    background: #4A90E2;
    border-radius: 50%;
}

.timeline-content {
    background: #f9f9f9;
    padding: 0.8rem 1rem;
    border-radius: 8px;
    border: 1px solid #eee;
}

.timeline-header {
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.5rem;
    color: #555;
}

.timeline-date {
    font-weight: 600;
    color: #4A90E2;
}

.timeline-user {
    font-style: italic;
    color: #777;
}

.timeline-description {
    margin-bottom: 0.5rem;
    color: #333;
    font-size: 0.95rem;
}

.timeline-changes {
    list-style: none;
    padding-left: 0;
    margin: 0;
}

.timeline-changes li {
    font-size: 0.9rem;
    margin-bottom: 0.3rem;
}

.timeline-changes .old {
    color: #999;
}

.timeline-changes .new {
    color: #27ae60;
    font-weight: 600;
}


.delete-btn-new {
    background: transparent;
    border: none;
    color: #dc3545; /* red color */
    cursor: pointer;
    /* font-size: 16px; */
    padding: 0;
    height: 20px;
    margin-left: 10px;
    transition: color 0.2s;
}

.delete-btn-new:hover {
    color: #a71d2a; /* darker red on hover */
}

.storung-delete-form {
    max-height:20px;
}

.comment-delete-form {
    display: flex;
    align-items: center;
}

.dialog-hide-unique {
    display: none;
}
.customer-info-card {
    border: 1px solid #ccc;
    padding: 15px;
    background-color: inherit;
    width: 100%;          /* FULL WIDTH OF PARENT */
    max-width: 100%;      /* NO LIMITS FROM FIXED WIDTH */
    margin-top: 10px;
    box-sizing: border-box;
}

.customer-info-title {
    font-size: 16px;
    font-weight: bold;
    margin-bottom: 12px;
    border-bottom: 1px solid #ddd;
    padding-bottom: 5px;
}

.customer-info-card .im-form-input-view-only {
    margin-bottom: 10px; /* space between attributes */
}

.truncate-text {
    display: inline-block;
    max-width: 220px; /* Breite anpassen */
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    vertical-align: bottom;
}
.supplier-row  {
     border: 1px solid #d1d5db;         /* light gray border */
     padding: 10px;                      /* space inside the box */
     margin: 20px 0;                     /* spacing outside the box */
     transition: transform 0.2s, box-shadow 0.2s;
 }


.supplier-row-header {
    display: flex;
    justify-content: flex-end; /* pushes delete icon to the right */
    margin-bottom: 10px; /* optional spacing */
}

