/********************/
/* CSS VARIABLES    */
/********************/

:root {
    --color-primary: #0066cc;
    --color-primary-light: #3399ff;
    --color-primary-dark: #004d99;

    --color-secondary: #6c757d;
    --color-accent: #ff9900;

    --color-bg-main: #ffffff;
    --color-bg-secondary: #f8f9fa;
    --color-bg-card: #ffffff;

    --color-text-primary: #181729;
    --color-text-secondary: rgba(24, 23, 41, 0.55);
    --color-text-light: #6c757d;

    --color-border: #e0e0e0;
    --color-border-light: #f2f2f2;
    --color-shadow: rgba(0, 0, 0, 0.08);

    --color-input-bg: #fafafa;
    --color-input-border: #ccc;
    --color-input-focus: #0066cc;

    --color-triage-neu: #6c757d;
    --color-triage-erledigt: #28a745;
    --color-triage-zurueckgestellt: #fd7e14;
    --color-triage-abgelehnt: #dc3545;
    --color-triage-abklaerung: #6f42c1;

    --max-width: 1440px;
    --border-radius: 8px;
    --box-shadow-sm: 0 2px 4px var(--color-shadow);
    --box-shadow-md: 0 4px 12px var(--color-shadow);
    --box-shadow-lg: 0 8px 24px var(--color-shadow);

    --spacing-xs: 4px;
    --spacing-sm: 8px;
    --spacing-md: 16px;
    --spacing-lg: 24px;
    --spacing-xl: 32px;

    --header-height: 104px;
    --filter-section-height: 200px; /* Default fallback, updated by JS */
}

/********************/
/* GENERAL RESET    */
/********************/

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    font-size: 16px;
}

body {
    display: flex;
    flex-direction: column;
    align-items: center;
    background-color: var(--color-bg-secondary);
    padding: 0 var(--spacing-xl) var(--spacing-xl) var(--spacing-xl);
    margin: 0;
    font-family: "Open Sans", sans-serif;
    font-size: 14px;
    color: var(--color-text-primary);
    line-height: 1.6;
    min-height: 100vh;
    max-width: var(--max-width);
    margin: 0 auto;
    width: 100%;
}

/********************/
/* HEADER           */
/********************/

header {
    z-index: 1000;
    background-color: var(--color-bg-main);
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    box-shadow: var(--box-shadow-sm);
}

.header__container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 104px;
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 var(--spacing-xl);
}

.header__container h1 {
    font-size: 24px;
    font-weight: 600;
    margin: 0;
    margin-left: auto;
    margin-right: auto;
    color: var(--color-text-primary);
}

.header__logo {
    height: 100px;
    object-fit: contain;
}

.header__logo--mobile {
    display: none;
}

.header__nav {
    display: flex;
    align-items: center;
    gap: var(--spacing-lg);
}

.header__link {
    color: var(--color-text-primary);
    font-size: 16px;
    font-weight: 500;
    text-decoration: none;
    transition: color 0.2s ease;
    position: relative;
}

.header__link:hover {
    color: var(--color-primary);
    text-decoration: underline;
    text-underline-offset: 4px;
}

.header__link--active {
    color: var(--color-primary);
    font-size: 16px;
    font-weight: 600;
    text-decoration: none;
}

.header__hamburger__menu {
    display: none;
}

/********************/
/* MAIN CONTENT     */
/********************/

main {
    display: flex;
    flex-direction: column;
    width: 100%;
    gap: var(--spacing-lg);
    padding-top: calc(var(--header-height) + var(--spacing-lg));
}

.main__content-area {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-lg);
    width: 100%;
}

/********************/
/* FILTER SECTION   */
/********************/

.filter-section {
    background: var(--color-bg-card);
    border-radius: var(--border-radius);
    padding: var(--spacing-lg);
    box-shadow: var(--box-shadow-md);
    position: sticky;
    top: var(--header-height);
    z-index: 900;
    border-top: 1px solid var(--color-border-light);
    border-bottom: 1px solid var(--color-border-light);
    transition: border-radius 0.3s ease;
}

.filter-section.is-stuck {
    border-radius: 0;
}

/* Desktop Filter Header: use baseline for optical alignment */
.filter-header-desktop {
    display: flex;
    align-items: baseline; /* aligns icon with text baseline */
    gap: 10px; /* slightly more breathing space */
    margin-bottom: var(--spacing-md);
}

.filter-header-desktop h2 {
    margin: 0;
    line-height: 1.2;
}

/* Reset icon button: optical vertical tweak with translateY */
.btn-reset-icon {
    background: transparent;
    border: none;
    color: var(--color-text-light);
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    transform: translateY(-1px); /* Feinjustierung: minimal weiter unten */
}

.btn-reset-icon:hover {
    background-color: rgba(0, 0, 0, 0.05);
    color: var(--color-primary);
    transform: translateY(-1px) rotate(-180deg);
}

.btn-reset-icon .material-symbols-outlined {
    font-size: 20px;
    line-height: 1;
    display: block; /* removes extra inline baseline space */
}

.btn-reset-mobile {
    background: none;
    border: none;
    color: var(--color-text-primary);
    padding: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    border-radius: 50%;
}

.btn-reset-mobile:hover {
    background-color: rgba(0, 0, 0, 0.05);
}

.filter-section h2 {
    font-size: 20px;
    font-weight: 600;
    margin: 0 0 var(--spacing-md) 0;
    color: var(--color-text-primary);
}

.filter-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: var(--spacing-md);
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-sm);
}

.filter-group label {
    display: flex;
    align-items: center;
    gap: var(--spacing-xs);
    font-size: 14px;
    font-weight: 500;
    color: var(--color-text-secondary);
    margin: 0;
}

.filter-group label .material-symbols-outlined {
    font-size: 18px;
    color: var(--color-primary);
}

.info-button {
    background: none;
    border: none;
    padding: 0;
    margin-left: 4px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.info-button:hover {
    background-color: transparent;
    transform: none;
    box-shadow: none;
}

.info-button .material-symbols-outlined {
    font-size: 16px;
    color: var(--color-text-secondary) !important;
}

.info-button .info-icon {
    font-variation-settings: "FILL" 1, "wght" 400, "GRAD" 0, "opsz" 24;
}

.info-button:hover .material-symbols-outlined {
    color: var(--color-primary) !important;
}

.sort-buttons {
    display: flex;
    gap: var(--spacing-sm);
}

/********************/
/* INPUTS & BUTTONS */
/********************/

.input-with-clear {
    position: relative;
    display: flex;
    align-items: center;
    width: 100%;
}

.input-with-clear input[type="text"] {
    padding-right: 36px;
    width: 100%;
    box-sizing: border-box;
}

.clear-input-btn {
    position: absolute;
    right: 4px;
    background: none;
    border: none;
    padding: 4px;
    cursor: pointer;
    display: none;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.clear-input-btn.visible {
    display: flex;
}

.clear-input-btn .material-symbols-outlined {
    font-size: 18px;
    color: var(--color-text-secondary) !important;
}

.clear-input-btn:hover .material-symbols-outlined {
    color: var(--color-primary) !important;
}

input[type="text"] {
    padding: 10px 12px;
    border: 1px solid var(--color-input-border);
    border-radius: var(--border-radius);
    font-size: 14px;
    font-family: "Open Sans", sans-serif;
    background-color: var(--color-input-bg);
    color: var(--color-text-primary);
    transition: all 0.3s ease;
}

input[type="text"]:focus {
    border-color: var(--color-input-focus);
    background-color: var(--color-bg-main);
    outline: none;
}

input[type="text"]::placeholder {
    color: #9e9e9e;
    font-style: italic;
    font-weight: 400;
    opacity: 1; /* Firefox override */
}

button {
    background-color: var(--color-bg-main);
    color: var(--color-text-primary);
    border: 1px solid var(--color-border);
    padding: 10px 16px;
    border-radius: var(--border-radius);
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    font-family: "Open Sans", sans-serif;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: var(--spacing-xs);
}

button:hover {
    background-color: #f0f0f0;
    border-color: #999;
}

button:active {
    transform: translateY(0);
    background-color: #e8e8e8;
}

.btn-icon {
    padding: 8px;
    min-width: 40px;
    justify-content: center;
}

.btn-icon .material-symbols-outlined {
    font-size: 20px;
}

/* Datum Sortierung im Tabellenkopf */
.th-date-inner {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 6px;
}

.th-date-label {
    font-weight: 600;
}

.sort-group {
    display: flex;
    gap: 3px;
}

.sort-btn {
    background-color: #f5f5f5;
    border: 1px solid var(--color-border);
    padding: 2px 5px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    cursor: pointer;
    min-width: 26px;
    height: 22px;
    transition: background-color 0.2s ease, border-color 0.2s ease;
    position: relative;
    line-height: 1;
}

.sort-btn .material-symbols-outlined {
    font-size: 15px;
    color: var(--color-text-secondary);
    transition: color 0.2s ease;
}

.sort-btn:hover {
    background-color: #ebebeb;
    border-color: #999;
}

.sort-btn:focus-visible {
    outline: 2px solid var(--color-primary);
    outline-offset: 2px;
}

.sort-btn:active {
    background-color: #e0e0e0;
}

.sort-btn.active {
    background-color: #e8e8e8;
    border-color: #999;
}

.sort-btn.active .material-symbols-outlined {
    color: var(--color-text-primary);
}

/********************/
/* MULTISELECT      */
/********************/

.multiselect-wrapper {
    position: relative;
}

.multiselect-button {
    width: 100%;
    justify-content: space-between;
    background-color: var(--color-input-bg);
    border: 1px solid var(--color-input-border);
    text-align: left;
    padding: 10px 12px;
}

.multiselect-button:hover {
    background-color: #f5f5f5;
    border-color: #999;
}

.multiselect-button .material-symbols-outlined {
    font-size: 20px;
    transition: transform 0.3s ease;
}

.multiselect-button.active .material-symbols-outlined {
    transform: rotate(180deg);
}

.multiselect-dropdown {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    background: var(--color-bg-main);
    border: 1px solid var(--color-border);
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow-md);
    max-height: 300px;
    overflow-y: auto;
    z-index: 100;
    display: none;
    padding: var(--spacing-sm);

    /* Modern Scrollbar Styling */
    scrollbar-width: thin;
    scrollbar-color: #ccc transparent;
}

.multiselect-dropdown::-webkit-scrollbar {
    width: 6px;
}

.multiselect-dropdown::-webkit-scrollbar-track {
    background: transparent;
}

.multiselect-dropdown::-webkit-scrollbar-thumb {
    background-color: #ccc;
    border-radius: 3px;
}

.multiselect-dropdown::-webkit-scrollbar-thumb:hover {
    background-color: #bbb;
}

.multiselect-dropdown.active {
    display: block;
}

.multiselect-actions {
    display: flex;
    gap: 8px;
    padding: 8px 12px;
    background-color: var(--color-bg-secondary);
    border-radius: 6px;
    margin: 8px;
}

.multiselect-action-btn {
    flex: 1;
    padding: 8px;
    min-height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: var(--color-bg-main);
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.multiselect-action-btn:hover {
    background-color: var(--color-primary);
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.multiselect-action-btn .material-symbols-outlined {
    font-size: 18px;
    color: var(--color-text-secondary);
}

.multiselect-action-btn:hover .material-symbols-outlined {
    color: white;
}

.multiselect-divider {
    height: 1px;
    background-color: var(--color-border);
    margin: 0 8px 8px 8px;
}

.checkbox-label {
    display: flex;
    align-items: center;
    padding: var(--spacing-sm);
    cursor: pointer;
    border-radius: 4px;
    transition: background-color 0.15s ease;
    user-select: none;
}

.checkbox-label:hover {
    background-color: #f5f5f5;
}

.checkbox-label input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    cursor: pointer;
}

.checkbox-custom {
    position: relative;
    width: 18px;
    height: 18px;
    border: 2px solid var(--color-border);
    border-radius: 3px;
    margin-right: var(--spacing-sm);
    transition: all 0.2s ease;
}

.checkbox-label input[type="checkbox"]:checked ~ .checkbox-custom {
    background-color: var(--color-primary);
    border-color: var(--color-primary);
}

.checkbox-label input[type="checkbox"]:checked ~ .checkbox-custom::after {
    content: "";
    position: absolute;
    left: 5px;
    top: 2px;
    width: 4px;
    height: 8px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

/********************/
/* TABLE CARD       */
/********************/

.table-card {
    background: var(--color-bg-card);
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow-md);
    /* overflow: hidden; removed to allow sticky header */
}

/* .table-header removed */

.table-wrapper {
    /* overflow-x: auto; removed to allow sticky header to work relative to viewport */
    width: 100%;
}

/********************/
/* TABLE            */
/********************/

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

table thead {
    /* position: sticky; moved to th */
    z-index: 800;
}

table th {
    padding: var(--spacing-md);
    text-align: left;
    font-weight: 600;
    color: var(--color-text-primary);
    border-bottom: 2px solid var(--color-border);
    white-space: nowrap;
    background-color: var(--color-bg-main); /* White background */
    position: sticky;
    top: calc(var(--header-height) + var(--filter-section-height));
    z-index: 800;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

table td {
    padding: var(--spacing-md);
    border-bottom: 2px solid #d0d0d0; /* Thicker and darker border */
    vertical-align: top;
}

/* IT Category: Always single line, no wrapping */
table th:nth-child(4),
table td:nth-child(4) {
    white-space: nowrap;
}

/* Brief Description: Allow text wrapping with max width (Desktop only) */
table th:nth-child(5),
table td:nth-child(5) {
    white-space: normal;
    word-wrap: break-word;
}

@media screen and (min-width: 651px) {
    table th:nth-child(5),
    table td:nth-child(5) {
        max-width: 300px;
    }
}

table tbody tr {
    background-color: var(--color-bg-main);
    transition: background-color 0.15s ease;
}

table tbody tr:hover {
    background-color: #f8f9fa;
}

table tbody tr:last-child td {
    border-bottom: none;
}

table a {
    color: var(--color-primary);
    text-decoration: none;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    gap: var(--spacing-xs);
    transition: color 0.2s ease;
}

table a:hover {
    color: var(--color-primary-dark);
}

/********************/
/* Expandable Row Styles */
/********************/

tr.summary-row {
    cursor: pointer;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}

tr.summary-row:hover {
    background-color: #f0f4f8;
}

tr.summary-row:active {
    background-color: #e8f0f8;
}

tr.summary-row td {
    border-bottom: none; /* Remove border from summary row to merge visually with detail if needed, or keep it */
    border-bottom: 1px solid var(--color-border-light);
}

tr.summary-row.expanded td {
    border-bottom: none;
    background-color: #f8f9fa;
}

tr.detail-row {
    display: none;
}

tr.detail-row.visible {
    display: table-row;
}

tr.detail-row td {
    padding: 0;
    border-bottom: 2px solid #d0d0d0;
    background-color: #f8f9fa;
    display: table-cell !important; /* Force display even if nth-child rules apply */
}

.detail-content {
    padding: var(--spacing-lg);
    border-top: 1px dashed var(--color-border);
    animation: slideDown 0.3s ease-out;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.chevron-icon {
    transition: transform 0.3s ease;
    color: var(--color-text-light);
}

tr.summary-row.expanded .chevron-icon {
    transform: rotate(180deg);
    color: var(--color-primary);
}

/* Status Badges */
.status-badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
    text-align: center;
    white-space: nowrap;
    min-width: 80px;
    border: 1px solid transparent;
    color: #000000;
}

/* Status Colors matching Asana */

.status-neu {
    background-color: #80deea; /* Cyan - hellblau */
}

.status-bearbeitung {
    background-color: #c5e1a5; /* Light Green - hellgrün */
}

.status-offen {
    background-color: #9e9e9e; /* Grey - grau */
}

.status-erledigt {
    background-color: #e0e0e0; /* Light Grey - hellgrau */
}

.status-geplant {
    background-color: #ffeb3b; /* Yellow - gelb */
}

.status-warten-auf-antwort {
    background-color: #ffb74d; /* Orange - orange */
}

.status-warten-auf-bestellung {
    background-color: #ce93d8; /* Purple - lila */
}

.status-problem {
    background-color: #ef9a9a; /* Red - rot */
}

.status-information {
    background-color: #ce93d8; /* Purple - lila */
}

.status-default {
    background-color: #f5f5f5; /* Grey 100 */
}

/********************/
/* DASHBOARD        */
/********************/

.dashboard-card {
    background: var(--color-bg-card);
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow-md);
    overflow: hidden;
    margin-bottom: var(--spacing-lg);
}

.dashboard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--spacing-lg);
    background: var(--color-bg-card);
    cursor: pointer;
    user-select: none;
    transition: background-color 0.15s ease;
}

.dashboard-header:hover {
    background-color: #fafafa;
}

.dashboard-header-content {
    display: flex;
    align-items: center;
    gap: 10px;
}

.dashboard-icon {
    color: var(--color-text-secondary);
    font-size: 20px;
}

.dashboard-header h2 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    color: var(--color-text-primary);
}

.dashboard-chevron {
    color: var(--color-text-secondary);
    font-size: 20px;
    transition: transform 0.3s ease;
}

.dashboard-header.expanded .dashboard-chevron {
    transform: rotate(180deg);
}

.dashboard-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s ease, padding 0.4s ease;
    padding: 0 var(--spacing-lg);
    background: var(--color-bg-card);
}

.dashboard-content.visible {
    max-height: 600px;
    padding: var(--spacing-lg);
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 1px;
    background: #e0e0e0;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    overflow: hidden;
}

.stat-card {
    background: var(--color-bg-card);
    padding: 20px 16px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 100px;
    transition: all 0.2s ease;
    cursor: pointer;
    user-select: none;
}

.stat-card:hover {
    background-color: #f5f5f5;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.stat-card:active {
    transform: translateY(0);
}

.stat-icon-wrapper {
    display: none;
}

.stat-info {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    width: 100%;
}

.stat-label {
    font-size: 12px;
    font-weight: 500;
    color: var(--color-text-secondary);
    text-align: center;
    line-height: 1.3;
}

.stat-value {
    font-size: 32px;
    font-weight: 300;
    color: var(--color-text-primary);
    line-height: 1;
    letter-spacing: -0.5px;
}

.stat-total .stat-value {
    font-weight: 500;
    color: var(--color-primary);
}

/********************/
/* FOOTER           */
/********************/

footer {
    margin-top: auto;
    padding-top: var(--spacing-xl);
}

.footer__container {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 12px;
    padding: var(--spacing-lg) 0;
    color: var(--color-text-light);
    font-size: 13px;
}

.footer__links {
    display: flex;
    align-items: center;
    gap: 12px;
}

.footer__link {
    color: var(--color-text-light);
    text-decoration: none;
    transition: color 0.2s ease;
    font-size: 13px;
}

.footer__link:hover {
    color: var(--color-primary);
    text-decoration: underline;
}

.footer__separator {
    color: var(--color-border);
    user-select: none;
}

/********************/
/* UTILITY CLASSES  */
/********************/

mark {
    background-color: #fff59d;
    padding: 2px 4px;
    border-radius: 3px;
    font-weight: 500;
}

/********************/
/* TOOLTIP          */
/********************/

.asana-link-wrapper {
    position: relative;
    display: inline-block;
}

.asana-tooltip {
    position: absolute;
    bottom: calc(100% + 12px);
    right: 0;
    background-color: #2c3e50;
    color: #ffffff;
    padding: 12px 14px;
    border-radius: 8px;
    font-size: 12px;
    line-height: 1.4;
    width: 220px;
    box-sizing: border-box;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
    opacity: 0;
    visibility: hidden;
    transform: translateY(4px);
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 1000;
    pointer-events: none;
    word-wrap: break-word;
    overflow-wrap: break-word;
    hyphens: auto;
}

.asana-tooltip::after {
    content: "";
    position: absolute;
    top: 100%;
    right: 20px;
    width: 0;
    height: 0;
    border-style: solid;
    border-width: 8px 8px 0 8px;
    border-color: #2c3e50 transparent transparent transparent;
}

.asana-link-wrapper:hover .asana-tooltip {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.asana-tooltip-content {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    color: rgba(255, 255, 255, 0.95);
    font-weight: 400;
    word-break: break-word;
}

.asana-tooltip-icon {
    flex-shrink: 0;
    font-size: 16px !important;
    color: #ffd700;
    margin-top: 1px;
}

/********************/
/* LEGAL PAGES      */
/********************/

.legal-content {
    max-width: 800px;
    margin: 0 auto;
    padding: var(--spacing-xl);
    line-height: 1.6;
}

.legal-content h2 {
    color: var(--color-text-primary);
    font-size: 28px;
    margin-bottom: var(--spacing-lg);
    border-bottom: 2px solid var(--color-primary);
    padding-bottom: var(--spacing-sm);
}

.legal-content h3 {
    color: var(--color-text-primary);
    font-size: 20px;
    margin-top: var(--spacing-xl);
    margin-bottom: var(--spacing-md);
}

.legal-content h4 {
    color: var(--color-text-primary);
    font-size: 16px;
    margin-top: var(--spacing-lg);
    margin-bottom: var(--spacing-sm);
}

.legal-content p {
    color: var(--color-text-primary);
    margin-bottom: var(--spacing-md);
}

.legal-content ul {
    margin-left: var(--spacing-lg);
    margin-bottom: var(--spacing-md);
}

.legal-content li {
    margin-bottom: var(--spacing-sm);
    color: var(--color-text-primary);
}

.legal-content a {
    color: var(--color-primary);
    text-decoration: none;
}

.legal-content a:hover {
    text-decoration: underline;
}

.legal-content em {
    .in-progress-container {
        text-align: center;
        padding: var(--spacing-xl) 0;
        margin: var(--spacing-xl) 0;
    }

    .in-progress-icon {
        font-size: 80px !important;
        color: var(--color-text-secondary);
        display: block;
        margin: 0 auto var(--spacing-lg);
        opacity: 0.6;
    }

    .in-progress-text {
        font-size: 18px;
        font-weight: 500;
        color: var(--color-text-primary);
        margin-bottom: var(--spacing-sm);
    }

    .in-progress-subtext {
        font-size: 14px;
        color: var(--color-text-secondary);
    }

    color: var(--color-text-secondary);
    font-size: 14px;
}

.back-link {
    margin-top: var(--spacing-xl);
    padding-top: var(--spacing-lg);
    border-top: 1px solid var(--color-border);
}

.back-link a {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--color-primary);
    text-decoration: none;
    font-weight: 500;
    transition: gap 0.2s ease;
}

.back-link a:hover {
    gap: 12px;
}

.back-link .material-symbols-outlined {
    font-size: 20px;
}

/********************/
/* MODAL            */
/********************/

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    backdrop-filter: blur(4px);
}

.modal-overlay.active {
    display: flex;
}

.modal {
    background: var(--color-bg-main);
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    max-width: 500px;
    width: 90%;
    max-height: 80vh;
    overflow: hidden;
    animation: modalSlideIn 0.3s ease;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--spacing-lg);
    border-bottom: 1px solid var(--color-border);
    background: var(--color-bg-main);
    color: var(--color-text-primary);
}

.modal-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    color: var(--color-text-primary);
}

.modal-close {
    background: transparent;
    border: none;
    padding: 4px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background-color 0.2s ease;
}

.modal-close:hover {
    background-color: rgba(0, 0, 0, 0.05);
    transform: none;
    box-shadow: none;
}

.modal-close .material-symbols-outlined {
    font-size: 24px;
    color: var(--color-text-secondary);
}

.modal-content {
    padding: var(--spacing-lg);
    max-height: calc(80vh - 80px);
    overflow-y: auto;
}

.modal-status-item {
    padding: var(--spacing-md) 0;
    border-bottom: 1px solid var(--color-border-light);
}

.modal-status-item:last-child {
    border-bottom: none;
}

.modal-status-item strong {
    display: block;
    color: var(--color-primary);
    font-size: 15px;
    margin-bottom: 4px;
}

.modal-status-item p {
    color: var(--color-text-secondary);
    font-size: 14px;
    margin: 0;
    line-height: 1.5;
}

/********************/
/* RESPONSIVE       */
/********************/

@media screen and (max-width: 1250px) {
    table th:nth-child(5),
    table td:nth-child(5) {
        display: none;
    }
}

@media screen and (max-width: 1020px) {
    .filter-grid {
        grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    }
}

/********************/
/* MOBILE ELEMENTS  */
/********************/

.mobile-nav-overlay {
    position: fixed;
    top: 0;
    right: -100%;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 2000;
    transition: right 0.3s ease;
    backdrop-filter: blur(4px);
    display: flex;
    justify-content: flex-end;
}

.mobile-nav-overlay.active {
    right: 0;
}

.mobile-nav-content {
    width: 80%;
    max-width: 300px;
    height: 100%;
    background-color: var(--color-bg-main);
    padding: var(--spacing-xl);
    display: flex;
    flex-direction: column;
    box-shadow: -4px 0 12px rgba(0, 0, 0, 0.1);
}

.mobile-nav-close {
    align-self: flex-end;
    background: none;
    border: none;
    padding: 8px;
    cursor: pointer;
    margin-bottom: var(--spacing-xl);
}

.mobile-nav-links {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-lg);
}

.mobile-nav-link {
    font-size: 18px;
    font-weight: 500;
    color: var(--color-text-primary);
    text-decoration: none;
    padding: var(--spacing-sm) 0;
    border-bottom: 1px solid var(--color-border-light);
}

.mobile-nav-link.active {
    color: var(--color-primary);
    font-weight: 600;
}

.mobile-filter-toggle {
    display: none;
    width: 100%;
    padding: 12px;
    background-color: var(--color-bg-main);
    border: 1px solid var(--color-border);
    border-radius: var(--border-radius);
    font-size: 14px;
    font-weight: 600;
    color: var(--color-text-primary);
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-bottom: 0;
    box-shadow: var(--box-shadow-sm);
    position: sticky;
    top: var(--header-height);
    z-index: 890;
}

.filter-badge {
    background-color: var(--color-primary);
    color: white;
    border-radius: 12px;
    padding: 2px 8px;
    font-size: 12px;
    min-width: 20px;
    text-align: center;
}

.filter-header-mobile,
.filter-actions-mobile,
.filter-close-mobile {
    display: none;
}

/********************/
/* RESPONSIVE       */
/********************/

@media screen and (max-width: 1250px) {
    /* Verstecke Brief Description bei kleineren Bildschirmen */
    table th:nth-child(5),
    table td:nth-child(5) {
        display: none;
    }
}

@media screen and (max-width: 1020px) {
    .filter-grid {
        grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    }
}

@media screen and (max-width: 860px) {
    /* Dashboard: 3 Spalten für Tablets */
    .stats-grid {
        grid-template-columns: repeat(3, 1fr));
    }

    /* Header Adjustments */
    .header__link--active,
    .header__link {
        display: none;
    }

    .header__hamburger__menu {
        display: flex;
        flex-direction: column;
        justify-content: space-between;
        width: 24px;
        height: 18px;
        cursor: pointer;
    }

    .header__hamburger__bar {
        width: 100%;
        height: 2px;
        background-color: var(--color-text-primary);
        border-radius: 2px;
    }

    /* Filter Mobile Logic */
    .mobile-filter-toggle {
        display: flex;
    }

    .filter-section {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        z-index: 2100;
        border-radius: 0;
        overflow-y: auto;
        transform: translateY(100%);
        transition: transform 0.3s ease;
        display: flex;
        flex-direction: column;
        padding: 0;
    }

    .filter-section.active {
        transform: translateY(0);
    }

    .filter-header-mobile {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: var(--spacing-lg);
        background-color: var(--color-bg-main);
        border-bottom: 1px solid var(--color-border);
        position: sticky;
        top: 0;
        z-index: 10;
    }

    .filter-header-desktop {
        display: none;
    }

    .filter-header-mobile h2 {
        margin: 0;
        font-size: 18px;
    }

    .filter-close-mobile {
        display: flex;
        background: none;
        border: none;
        padding: 4px;
        cursor: pointer;
    }

    .filter-section > h2 {
        display: none; /* Hide default h2 */
    }

    .filter-grid {
        grid-template-columns: 1fr;
        padding: var(--spacing-lg);
        flex: 1;
        overflow-y: auto;
    }

    .filter-actions-mobile {
        display: flex;
        padding: var(--spacing-lg);
        background-color: var(--color-bg-main);
        border-top: 1px solid var(--color-border);
        position: sticky;
        bottom: 0;
    }

    .apply-filters-btn {
        width: 100%;
        background-color: var(--color-primary);
        color: white;
        border: none;
        padding: 12px;
        border-radius: var(--border-radius);
        font-weight: 600;
        cursor: pointer;
    }

    /* Dashboard Mobile Adjustments - Match Filter Toggle Style */
    .dashboard-card {
        background-color: var(--color-bg-main);
        border: 1px solid var(--color-border);
        border-radius: var(--border-radius);
        box-shadow: var(--box-shadow-sm);
        margin-bottom: 0;
        overflow: hidden;
        position: sticky;
        top: calc(var(--header-height) + 49px);
        z-index: 885;
    }
    
    .dashboard-header {
        padding: 12px;
        background-color: var(--color-bg-main);
        justify-content: center;
        position: relative;
    }
    
    .dashboard-header:hover {
        background-color: var(--color-bg-main);
    }
    
    .dashboard-header h2 {
        font-size: 14px;
        font-weight: 600;
        color: var(--color-text-primary);
        margin: 0;
    }
    
    .dashboard-header-content {
        gap: 8px;
    }
    
    .dashboard-icon {
        font-size: 24px;
        color: var(--color-text-primary);
    }
    
    .dashboard-chevron {
        font-size: 24px;
        color: var(--color-text-primary);
        position: absolute;
        right: 12px;
    }
    
    .dashboard-content {
        padding: 0;
        background: var(--color-bg-main);
    }
    
    .dashboard-content.visible {
        padding: var(--spacing-md);
        border-top: 1px solid var(--color-border);
    }
    
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .stat-card {
        min-height: 90px;
        padding: 16px 12px;
    }

    .stat-value {
        font-size: 28px;
    }

    /* Table Adjustments - Mobile: Zeige nur ID, Kurzbeschrieb, Chevron */
    /* Verstecke: Datum (2), Submitter (3), IT Kategorie (4), Status (6) */
    table th:nth-child(2),
    table td:nth-child(2),
    table th:nth-child(3),
    table td:nth-child(3),
    table th:nth-child(4),
    table td:nth-child(4),
    table th:nth-child(6),
    table td:nth-child(6) {
        display: none;
    }

    /* Brief Description wieder anzeigen auf Mobile (überschreibt 1250px Regel) */
    table th:nth-child(5),
    table td:nth-child(5) {
        display: table-cell;
    }

    /* ID Spalte: Kompakt, zentriert, optimiert */
    table th:nth-child(1),
    table td:nth-child(1) {
        width: 50px;
        min-width: 50px;
        max-width: 50px;
        padding: 12px 6px;
        text-align: center;
        font-size: 12px;
        font-weight: 600;
    }

    /* Brief Description: Maximalen Platz nutzen */
    table th:nth-child(5),
    table td:nth-child(5) {
        padding: 12px 8px;
    }

    /* Chevron Spalte: Kompakt */
    table th:nth-child(7),
    table td:nth-child(7) {
        width: 44px;
        min-width: 44px;
        max-width: 44px;
        padding: 12px 6px;
        text-align: center;
    }

    /* Increase touch targets for mobile */
    tr.summary-row td {
        padding: 14px 8px;
        min-height: 48px;
    }

    tr.summary-row td:nth-child(1) {
        padding: 14px 6px;
    }

    tr.summary-row td:nth-child(5) {
        padding: 14px 8px;
    }

    tr.summary-row td:nth-child(7) {
        padding: 14px 6px;
    }

    /* Detail Content: Linksbündig, nicht zentriert */
    .detail-content {
        text-align: left;
        padding: var(--spacing-md);
    }

    .chevron-icon {
        font-size: 24px;
    }

    /* Table Header sticky unter Filter-Button und Dashboard */
    table th {
        top: calc(var(--header-height) + 49px + 49px);
        z-index: 880;
    }
}



@media screen and (max-width: 650px) {
    body {
        padding: 0 var(--spacing-md) var(--spacing-md) var(--spacing-md);
    }

    main {
        padding-top: calc(var(--header-height) + var(--spacing-md));
    }

    .header__container {
        padding: 0 var(--spacing-md);
    }

    .header__container h1 {
        font-size: 16px;
        text-align: center;
        font-size: 0;
        position: absolute;
        left: 50%;
        transform: translateX(-50%);
    }
    
    .header__container h1::before {
        content: attr(data-mobile-text);
        font-size: 16px;
    }

    .header__logo--desktop {
        display: none;
    }
    
    .header__logo--mobile {
        display: block;
        height: 40px;
        width: 40px;
        object-fit: contain;
    }

    :root {
        --header-height: 80px;
    }

    .header__container {
        height: 80px;
        position: relative;
    }
}

@media screen and (max-width: 560px) {
    body {
        font-size: 13px;
    }

    table {
        font-size: 13px;
    }

    table th,
    table td {
        padding: var(--spacing-sm);
    }

    /* Ensure touch targets remain accessible even on smallest screens */
    tr.summary-row td {
        padding: 12px 6px;
    }

    .chevron-icon {
        font-size: 22px;
    }

    /* Dashboard: Single column on very small screens */
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .stat-card {
        min-height: 80px;
        padding: 14px 10px;
    }

    .stat-value {
        font-size: 24px;
    }

    .stat-label {
        font-size: 11px;
    }

    /* Footer: Zentriert und besser lesbar auf Mobile */
    .footer__container {
        text-align: center;
        padding: var(--spacing-md) var(--spacing-sm);
    }

    .footer__container p {
        line-height: 1.6;
        max-width: 280px;
        margin: 0 auto;
    }

    .footer__links {
        flex-wrap: wrap;
        justify-content: center;
    }
}
