/* ---------------------------------- */
/* --- 1. GRUNDEINSTELLUNGEN & VARIABLEN --- */
/* ---------------------------------- */
:root {
    --bg-main: #1a1d23;
    --bg-secondary: #242831;
    --bg-tertiary: #2d3139;
    --bg-card-rgb: 36, 40, 49;
    /* RGB für rgba() Transparenz */
    --bg-input: rgba(26, 29, 35, 0.8);
    --border-color: rgba(255, 255, 255, 0.08);
    --text-primary: #ffffff;
    --text-secondary: #b8bec8;
    --text-muted: #6c7380;
    --accent-blue: #1e88e5;
    --accent-cyan: #00d4ff;
    --dark-gray: #4b5563;
    --status-green: #10B981;
    --status-yellow: #F59E0B;
    --status-red: #EF4444;
    --alert-green: rgba(16, 185, 129, 0.2);
    --alert-red: rgba(239, 68, 68, 0.2);
    --bg-footer: #0f1116;
    --bg-footer-bottom: #0a0c10;
}

html {
    background-color: var(--bg-main);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* ---------------------------------- */
/* --- 2. LAYOUT & HINTERGRUND --- */
/* ---------------------------------- */
body {
    font-family: 'Inter', 'Segoe UI', system-ui, -apple-system, sans-serif;
    background-color: var(--bg-main);
    color: var(--text-primary);
    overflow-x: hidden;

    /* Flexbox-Container für Sticky Footer */
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.page-wrapper {
    padding: 2rem;
    /* NEU: Dieser Container soll wachsen, um den Platz auszufüllen */
    flex-grow: 1;
}

.main-container {
    max-width: 1600px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

/* ---------------------------------- */
/* --- 3. GLASSMORPHISM CONTAINER --- */
/* ---------------------------------- */
.glass-container {
    background: rgba(var(--bg-card-rgb), 0.7);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    /* Für Safari-Kompatibilität */
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 1.5rem;
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.25);
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

/* ---------------------------------- */
/* --- 4. TYPOGRAFIE & BASIS-ELEMENTE --- */
/* ---------------------------------- */
h1,
h2,
h3,
h4 {
    font-weight: 600;
    color: var(--text-primary);
}

h1 {
    font-size: 2.25rem;
}

h2 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
}

h3 {
    font-size: 1.125rem;
    margin-bottom: 0.75rem;
}

p {
    color: var(--text-secondary);
    line-height: 1.6;
}

a {
    color: var(--accent-blue);
    text-decoration: none;
    transition: color 0.3s ease;
}

a:hover {
    color: var(--accent-cyan);
}

/* ---------------------------------- */
/* --- 5. KOMPONENTEN-STYLING --- */
/* ---------------------------------- */

/* --- Navigation --- */
.main-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.5rem;
    position: sticky;
    top: 0;
    z-index: 1000;
    background: rgba(26, 29, 35, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.nav-logo {
    font-size: 1.5rem;
    font-weight: 700;
}

.nav-links {
    display: flex;
    gap: 2rem;
}

.nav-links a {
    color: var(--text-secondary);
    font-weight: 500;
    transition: color 0.2s ease;
}

.nav-links a.active,
.nav-links a:hover {
    color: var(--text-primary);
}

/* --- Page Header --- */
.page-header h1 {
    margin-bottom: 0.25rem;
}

/* --- Benachrichtigungs-Box --- */
.alert-box {
    padding: 1rem 1.5rem;
    border-radius: 8px;
    border: 1px solid;
    margin-bottom: 2rem;
}

.alert-box.success {
    background-color: var(--alert-green);
    border-color: var(--status-green);
    color: var(--text-primary);
}

.alert-box.error {
    background-color: var(--alert-red);
    border-color: var(--status-red);
    color: var(--text-primary);
}

/* --- Stats-Karten --- */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
}

.stat-card {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.2);
    border-color: rgba(30, 136, 229, 0.3);
}

.stat-card .icon {
    font-size: 1.5rem;
    color: var(--accent-blue);
    margin-bottom: 1rem;
}

.stat-card .value {
    font-size: 2.5rem;
    font-weight: 700;
}

.stat-card .label {
    color: var(--text-secondary);
}

/* --- Daten-Tabelle --- */
.data-table-container {
    overflow-x: auto;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
}

.data-table th,
.data-table td {
    padding: 1rem;
    border-bottom: 1px solid var(--border-color);
}

.data-table thead {
    background-color: rgba(0, 0, 0, 0.2);
}

.data-table th {
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 1px;
    color: var(--text-secondary);
}

.data-table tbody tr {
    transition: transform 0.3s ease, background-color 0.3s ease;
}

.data-table tbody tr:hover {
    transform: translateY(-2px);
    background-color: var(--bg-tertiary);
    cursor: pointer;
}

/* --- Status Badges --- */
.status-badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.8rem;
    font-weight: 600;
    text-align: center;
    white-space: nowrap;
}

.status-badge.open {
    background-color: var(--status-green);
    color: #fff;
}

.status-badge.in-progress {
    background-color: var(--status-yellow);
    color: #111;
}

.status-badge.closed {
    background-color: var(--status-red);
    color: #fff;
}

.status-badge.dienst {
    background-color: var(--accent-blue);
    color: #fff;
}

/* --- Buttons --- */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: 'Inter', sans-serif;
}

.btn i {
    line-height: 1;
}

.btn-primary {
    background: linear-gradient(135deg, #1e88e5, #1565c0);
    color: var(--text-primary);
    box-shadow: 0 4px 16px rgba(30, 136, 229, 0.3);
}

.btn-primary:hover {
    background: linear-gradient(135deg, #2196f3, #1e88e5);
    transform: translateY(-2px);
    box-shadow: 0 6px 24px rgba(30, 136, 229, 0.4);
}

.btn-secondary {
    background-color: var(--bg-tertiary);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

.btn-secondary:hover {
    background-color: var(--dark-gray);
    transform: translateY(-2px);
}

.btn-discord {
    background-color: #5865F2;
    color: #fff;
}

.btn-discord:hover {
    background-color: #707bf4;
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(88, 101, 242, 0.3);
}

.btn-icon {
    padding: 0.75rem;
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-secondary);
}

.btn-icon:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
}

.action-buttons {
    display: flex;
    gap: 0.5rem;
}

/* --- Formulare --- */
.form-container {
    max-width: 800px;
    margin: 0 auto;
}

fieldset {
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 2rem;
    margin-bottom: 1.5rem;
}

legend {
    padding: 0 0.5rem;
    margin-left: 1rem;
    color: var(--accent-blue);
    font-weight: 600;
}

.form-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
}

@media (min-width: 640px) {
    .form-grid.two-cols {
        grid-template-columns: 1fr 1fr;
    }
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.form-group label {
    font-weight: 500;
    color: var(--text-secondary);
    font-size: 0.875rem;
}

input[type="text"],
input[type="email"],
select,
textarea {
    width: 100%;
    background-color: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 0.75rem 1rem;
    color: var(--text-primary);
    font-family: 'Inter', sans-serif;
    font-size: 1rem;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

input[type="text"]:focus,
input[type="email"]:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: var(--accent-blue);
    box-shadow: 0 0 0 3px rgba(30, 136, 229, 0.3);
}

textarea {
    min-height: 120px;
    resize: vertical;
}

.custom-checkbox {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    cursor: pointer;
}

.custom-checkbox input[type="checkbox"] {
    display: none;
}

.custom-checkbox .checkmark {
    width: 20px;
    height: 20px;
    background-color: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.3s ease, border-color 0.3s ease;
    flex-shrink: 0;
}

.custom-checkbox .checkmark i {
    color: var(--text-primary);
    font-size: 12px;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.custom-checkbox input[type="checkbox"]:checked+.checkmark {
    background-color: var(--accent-blue);
    border-color: var(--accent-blue);
}

.custom-checkbox input[type="checkbox"]:checked+.checkmark i {
    opacity: 1;
}

/* ---------------------------------- */
/* --- 6. ANIMATIONEN & RESPONSIVITÄT --- */
/* ---------------------------------- */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.animated-component {
    animation: fadeInUp 0.5s ease-out forwards;
    opacity: 0;
}

.animated-component:nth-child(1) {
    animation-delay: 0.1s;
}

.animated-component:nth-child(2) {
    animation-delay: 0.2s;
}

.animated-component:nth-child(3) {
    animation-delay: 0.3s;
}

.animated-component:nth-child(4) {
    animation-delay: 0.4s;
}

/* --- Media Queries für Responsivität --- */
@media (max-width: 768px) {
    .page-wrapper {
        padding: 1rem;
    }

    .main-nav {
        flex-direction: column;
        gap: 1rem;
    }

    h1 {
        font-size: 1.75rem;
    }

    h2 {
        font-size: 1.25rem;
    }
}

/* --- Kommentar-Styling --- */
.comment-thread {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.comment-bubble {
    padding: 1rem;
    border-radius: 12px;
    background-color: rgba(17, 24, 39, 0.8);
    /* --bg-input */
    max-width: 80%;
    align-self: flex-start;
}

.comment-bubble.own-comment {
    background-color: rgba(59, 130, 246, 0.3);
    /* Akzentfarbe mit Transparenz */
    align-self: flex-end;
}

.comment-header {
    display: flex;
    justify-content: space-between;
    /* Drückt Datum nach rechts */
    align-items: center;
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
    flex-wrap: wrap;
    /* Bessere Darstellung auf kleinen Bildschirmen */
    gap: 0.5rem;
    /* Abstand zwischen den Elementen */
}

/* Ein Container für den linken Teil (Name + Badge) für besseres Spacing */
.comment-header>div {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.comment-bubble p {
    color: var(--text-primary);
    line-height: 1.5;
    white-space: pre-wrap;
    /* Damit Zeilenumbrüche aus dem Textarea erhalten bleiben */
}

/* --- Prioritäten-Styling --- */
.priority-badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.8rem;
    font-weight: 600;
    color: #fff;
    text-transform: capitalize;
}

.priority-niedrig {
    background-color: var(--status-green);
}

.priority-normal {
    background-color: var(--accent-blue);
}

.priority-hoch {
    background-color: var(--status-red);
}

/* --- System-Kommentar-Styling --- */
.comment-bubble.system-comment {
    background-color: rgba(var(--bg-card-rgb), 0.8);
    border: 1px dashed var(--border-color);
    align-self: center;
    text-align: center;
    max-width: 100%;
    font-style: italic;
}

/* --- Prioritäten-Styling --- */
.priority-badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.8rem;
    font-weight: 600;
    color: #fff;
    text-transform: capitalize;
}

.priority-niedrig {
    background-color: var(--status-green);
}

.priority-normal {
    background-color: var(--accent-blue);
}

.priority-hoch {
    background-color: var(--status-red);
}

/* --- System-Kommentar-Styling --- */
.comment-bubble.system-comment {
    background-color: rgba(var(--bg-card-rgb), 0.8);
    border: 1px dashed var(--border-color);
    align-self: center;
    text-align: center;
    max-width: 100%;
    font-style: italic;
}


/* --- Ticket Detailansicht (Zwei Spalten) --- */
.ticket-view-grid {
    display: grid;
    grid-template-columns: 1fr 350px;
    /* Hauptinhalt | Sidebar */
    gap: 2rem;
    align-items: flex-start;
}

.ticket-main-content {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.ticket-sidebar {
    position: sticky;
    top: 100px;
    /* Abstand zur oberen Team-Leiste/Navi */
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

/* Responsive Anpassung für kleinere Bildschirme */
@media (max-width: 1024px) {
    .ticket-view-grid {
        grid-template-columns: 1fr;
        /* Spalten untereinander anordnen */
    }

    .ticket-sidebar {
        position: static;
        /* Sticky-Positionierung aufheben */
        top: auto;
    }
}

/* --- Rollen-Badge im Kommentar --- */
.role-badge {
    display: inline-block;
    padding: 2px 8px;
    margin-left: 8px;
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: 6px;
    color: #fff;
    vertical-align: middle;
    text-transform: capitalize;
}

.role-supporter {
    background-color: #3b82f6;
}

.role-moderator {
    background-color: #10b981;
}

.role-developer {
    background-color: #8b5cf6;
}

.role-teamleitung {
    background-color: #f59e0b;
}

.role-administration {
    background-color: #ef4444;
}

.role-admin {
    background: linear-gradient(45deg, #ef4444, #f59e0b);
}

.role-projektinhaber {
    background: linear-gradient(45deg, #dddddd, #065ae1);
}


/* --- Interne Notiz Styling --- */
.comment-bubble.internal-note {
    background-color: rgba(245, 158, 11, 0.15);
    /* Leichter Gelbton */
    border: 1px dashed rgba(245, 158, 11, 0.5);
}


/* ... am Ende der CSS-Datei hinzufügen ... */

/* --- Kompaktere Infoboxen --- */
.info-box h3 {
    font-size: 1.125rem;
    color: var(--text-secondary);
    margin-bottom: 0.75rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--border-color);
}

.info-box p {
    white-space: pre-wrap;
    color: var(--text-primary);
    line-height: 1.6;
}

/* --- Gruppe für Aktions-Buttons in der Sidebar --- */
.action-button-group {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.action-button-group .btn {
    width: 100%;
    justify-content: center;
}

/* --- Department Hub Specific Styles --- */

/* Hero Section */
.page-header.hub-hero {
    background: linear-gradient(135deg, rgba(30, 136, 229, 0.15) 0%, rgba(15, 23, 42, 0) 100%);
    border: 1px solid rgba(255, 255, 255, 0.05);
    padding: 3rem 2rem;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.page-header.hub-hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(59, 130, 246, 0.5), transparent);
}

.page-header.hub-hero h1 {
    font-size: 3rem;
    background: linear-gradient(to right, #ffffff, #94a3b8);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 1rem;
    letter-spacing: -0.05em;
}

.page-header.hub-hero p {
    font-size: 1.1rem;
    max-width: 600px;
    margin: 0 auto;
    color: var(--text-secondary);
}

/* Departments Grid */
.departments-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 2rem;
    padding: 1rem 0;
}

.department-card {
    background: rgba(30, 41, 59, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 16px;
    overflow: hidden;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
    position: relative;
    backdrop-filter: blur(10px);
}

.department-card:hover {
    transform: translateY(-8px);
    background: rgba(30, 41, 59, 0.6);
    border-color: rgba(59, 130, 246, 0.3);
    box-shadow: 0 20px 40px -5px rgba(0, 0, 0, 0.3);
}

.dept-header {
    padding: 2rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    background: radial-gradient(circle at top, rgba(255, 255, 255, 0.03) 0%, transparent 70%);
}

.dept-icon-wrapper {
    width: 80px;
    height: 80px;
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1.5rem;
    font-size: 2rem;
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.2);
    position: relative;
}

.dept-icon-wrapper::after {
    content: '';
    position: absolute;
    inset: -2px;
    border-radius: 22px;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.2), transparent);
    z-index: -1;
}

.dept-name {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

.dept-head {
    font-size: 0.9rem;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: rgba(0, 0, 0, 0.2);
    padding: 0.25rem 0.75rem;
    border-radius: 99px;
}

.dept-body {
    padding: 0 2rem 2rem;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.dept-short-desc {
    color: var(--text-secondary);
    text-align: center;
    margin-bottom: 1.5rem;
    font-size: 0.95rem;
    line-height: 1.6;
}

.dept-footer {
    margin-top: auto;
    display: flex;
    justify-content: center;
}

.btn-dept-action {
    width: 100%;
    justify-content: center;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.btn-dept-action:hover {
    background: var(--accent-blue);
    border-color: var(--accent-blue);
    color: white;
}

/* Modal Polish */
.modal {
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(8px);
}

.modal-content {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-main);
}

::-webkit-scrollbar-thumb {
    background: var(--bg-tertiary);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

.accordion-container {
    border-top: 1px solid var(--border-color);
    margin-top: 1rem;
    padding-top: 1rem;
}

.accordion-item+.accordion-item {
    margin-top: 0.5rem;
}

.accordion-header {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 0.75rem 1rem;
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    font-size: 1rem;
    color: var(--text-primary);
    font-family: 'Inter', sans-serif;
    font-weight: 500;
    transition: background 0.2s ease;
}

.accordion-header:hover {
    background: var(--bg-tertiary);
}

.accordion-header .fa-chevron-down {
    transition: transform 0.3s ease;
}

.accordion-header.active .fa-chevron-down {
    transform: rotate(180deg);
}

.accordion-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s ease-out, padding 0.4s ease-out;
    background: transparent;
    color: var(--text-secondary);
    font-size: 0.95rem;
    line-height: 1.6;
}

.accordion-content.active {
    /* Setze einen ausreichend großen Wert, der den Inhalt nicht abschneidet */
    max-height: 1000px;
    padding: 1rem 0.5rem;
    transition: max-height 0.5s ease-in, padding 0.5s ease-in;
}

.accordion-content p {
    white-space: pre-wrap;
    /* Damit Zeilenumbrüche erhalten bleiben */
    color: var(--text-primary);
}

/* --- Statistik Dashboard Erweiterung --- */
.stats-dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

.stats-list {
    list-style-type: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.stats-list li {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--border-color);
}

.stats-list li:last-child {
    border-bottom: none;
}

.stats-list .value {
    font-weight: 600;
    font-size: 1.1rem;
}

.stale-ticket-link {
    color: var(--status-yellow);
    font-weight: 600;
}

.stale-ticket-link:hover {
    color: #fca5a5;
}

/* --- Modal (Popout) Styling --- */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 2000;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 1;
    transition: opacity 0.3s ease;
}

.modal-overlay.hidden {
    opacity: 0;
    pointer-events: none;
}

.modal-box {
    position: relative;
    max-width: 500px;
    width: 90%;
    padding: 2rem;
    transform: scale(1);
    transition: transform 0.3s ease;
}

.modal-overlay.hidden .modal-box {
    transform: scale(0.9);
}

.modal-close-btn {
    position: absolute;
    top: 10px;
    right: 15px;
    background: none;
    border: none;
    font-size: 2rem;
    color: var(--text-secondary);
    cursor: pointer;
    line-height: 1;
}

.modal-close-btn:hover {
    color: var(--text-primary);
}

/* --- Logo in der Navigation --- */
.nav-logo {
    display: flex;
    align-items: center;
    /* Zentriert Logo und Text vertikal */
    gap: 1rem;
    /* Abstand zwischen Logo und Text */
    font-size: 1.25rem;
    font-weight: 700;
}

.logo-icon {
    height: 36px;
    /* Höhe des Logos anpassen */
    width: auto;
    /* Breite passt sich automatisch an */
}

/* --- Tab-Navigation für Ticket-Listen --- */
.tab-nav {
    display: flex;
    gap: 0.5rem;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 1.5rem;
}

.tab-nav a {
    padding: 0.75rem 1.5rem;
    border-radius: 8px 8px 0 0;
    color: var(--text-secondary);
    font-weight: 600;
    text-decoration: none;
    border: 1px solid transparent;
    border-bottom: none;
    transform: translateY(1px);
    transition: all 0.2s ease-in-out;
}

.tab-nav a:hover {
    background-color: rgba(255, 255, 255, 0.05);
    color: var(--text-primary);
}

.tab-nav a.active {
    background-color: var(--bg-main);
    color: var(--text-primary);
    border-color: var(--border-color);
    border-bottom-color: var(--bg-main);
}

/* =================================================================== */
/* ===== RESPONSIVE DESIGN & MOBILE ANSICHT (ab 768px und kleiner) ===== */
/* =================================================================== */
@media (max-width: 768px) {

    /* --- Allgemeines Layout & Typografie --- */
    .page-wrapper {
        padding: 1rem;
    }

    h1 {
        font-size: 1.75rem;
    }

    h2 {
        font-size: 1.25rem;
    }

    .main-container {
        gap: 1.5rem;
    }

    /* --- Navigation --- */
    .main-nav {
        flex-direction: column;
        gap: 1.5rem;
    }

    .nav-links {
        gap: 1rem;
        font-size: 0.9rem;
        flex-wrap: wrap;
        /* NEU: Zentriere die Links, damit es auch bei einem Umbruch gut aussieht */
        justify-content: center;
    }

    /* --- Responsive Tabellen (Karten-Layout) --- */
    .data-table thead {
        display: none;
        /* Tabellenkopf auf Mobile ausblenden */
    }

    .data-table,
    .data-table tbody,
    .data-table tr,
    .data-table td {
        display: block;
        width: 100%;
    }

    .data-table tr {
        margin-bottom: 1rem;
        border: 1px solid var(--border-color);
        border-radius: 8px;
        padding: 1rem;
        background: rgba(var(--bg-card-rgb), 0.2);
    }

    .data-table td {
        display: flex;
        justify-content: space-between;
        /* Label links, Wert rechts */
        align-items: center;
        padding: 0.75rem 0.5rem;
        border-bottom: 1px solid var(--border-color);
        text-align: right;
        /* Textinhalt rechtsbündig */
    }

    .data-table td:last-child {
        border-bottom: none;
    }

    .data-table td::before {
        content: attr(data-label);
        /* Fügt das Label aus dem HTML ein */
        font-weight: 600;
        color: var(--text-secondary);
        text-align: left;
        /* Label linksbündig */
        margin-right: 1rem;
    }

    .data-table .action-buttons {
        justify-content: flex-end;
        /* Buttons rechtsbündig */
    }

    /* --- Formulare --- */
    .form-grid.two-cols {
        grid-template-columns: 1fr;
        /* Zwei-Spalten-Layout auf Mobile aufheben */
    }

    /* --- Ticket-Detailansicht --- */
    .ticket-view-grid {
        grid-template-columns: 1fr;
        /* Zwei Spalten werden zu einer */
    }

    .ticket-sidebar {
        position: static;
        top: auto;
    }

    /* --- Dashboard & Filter --- */
    .stats-grid,
    .stats-dashboard-grid {
        grid-template-columns: 1fr;
        /* Stats-Karten untereinander */
    }

    .tab-nav {
        flex-wrap: wrap;
        justify-content: center;
    }
}

/* --- Haupt-Footer --- */
.main-footer {
    display: flex;
    flex-direction: column;
    /* Ordnet die Textzeilen untereinander an */
    align-items: center;
    /* Zentriert alles horizontal in der Mitte */
    gap: 0.5rem;
    /* Fügt einen kleinen Abstand zwischen den Zeilen hinzu */
    padding: 1.5rem;
    margin-top: 2rem;
    background: var(--bg-footer);
    border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.main-footer p {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin: 0;
}

/* Auf kleinen Bildschirmen zentrieren wir den Text wieder untereinander */
@media (max-width: 768px) {
    .main-footer {
        flex-direction: column;
        gap: 0.5rem;
    }
}



/* --- Kommentar-Anhänge --- */
.comment-attachments {
    margin-top: 1rem;
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.attachment-link img {
    max-width: 150px;
    max-height: 100px;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    transition: transform 0.2s ease;
    width: 150px;
    height: 100px;
    object-fit: cover;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    transition: transform 0.2s ease;
    vertical-align: middle;
    /* Verhindert komische Abstände unter dem Bild */

}

.attachment-link img:hover {
    transform: scale(1.05);
}

/* --- Custom File Upload Button --- */
.custom-file-upload-container {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.file-input-wrapper {
    display: flex;
    align-items: center;
    gap: 1rem;
}

/* Versteckt den originalen, hässlichen Input-Button */
.file-input-hidden {
    display: none;
}

/* Das Label wird unser neuer, schicker Button.
   Die .btn und .btn-secondary Klassen machen die meiste Arbeit. */
.file-input-label {
    cursor: pointer;
    display: inline-flex;
    /* Damit es sich wie ein Button verhält */
}

/* Der Text, der den ausgewählten Dateinamen anzeigt */
.file-chosen-text {
    color: var(--text-secondary);
    font-style: italic;
    font-size: 0.9rem;
}

/* ---------------------------------- */
/* --- ACCESSIBILITY: FOCUS STATES --- */
/* ---------------------------------- */
*:focus-visible {
    outline: 2px solid var(--accent-blue);
    outline-offset: 2px;
}

/* ---------------------------------- */
/* --- STAR RATING (Input) --- */
/* ---------------------------------- */
.star-rating-input {
    display: flex;
    flex-direction: row-reverse;
    justify-content: center;
    gap: 0.25rem;
    font-size: 2rem;
}

.star-rating-input input[type="radio"] {
    display: none;
}

.star-rating-input label {
    cursor: pointer;
    color: var(--dark-gray);
    transition: color 0.2s ease, transform 0.2s ease;
}

.star-rating-input label:hover,
.star-rating-input label:hover~label,
.star-rating-input input[type="radio"]:checked~label {
    color: #f59e0b;
}

.star-rating-input label:hover {
    transform: scale(1.15);
}

/* --- Star Rating (Display) --- */
.star-rating-display {
    font-size: 1.3rem;
    display: inline-flex;
    gap: 0.15rem;
}

.star-rating-display .fa-star {
    color: #f59e0b;
}

.star-rating-display .far.fa-star {
    color: var(--dark-gray);
}

/* --- Rating Section --- */
.rating-section h3 {
    margin-bottom: 0.5rem;
}

/* ---------------------------------- */
/* --- ASSIGNED BADGE --- */
/* ---------------------------------- */
.assigned-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.2rem 0.6rem;
    background: rgba(30, 136, 229, 0.15);
    border: 1px solid rgba(30, 136, 229, 0.3);
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--accent-blue);
    white-space: nowrap;
}

.assigned-badge i {
    font-size: 0.75rem;
}

/* ---------------------------------- */
/* --- ACTIVITY FEED --- */
/* ---------------------------------- */
.activity-log-wrapper.glass-container {
    padding: 0;
    overflow: hidden;
}

.activity-log-wrapper .accordion-container {
    border-top: none;
    margin-top: 0;
    padding-top: 0;
}

.activity-log-wrapper .accordion-header {
    padding: 1.25rem 1.5rem;
    border: none;
    border-radius: 0;
}

.activity-log-wrapper .accordion-content {
    padding: 0;
}

.activity-log-wrapper .accordion-content.active {
    padding: 0.75rem 1.5rem 1.25rem;
}

.activity-feed {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.activity-item {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    padding: 0.75rem 0.5rem;
    border-bottom: 1px solid var(--border-color);
    transition: background 0.2s ease;
    border-radius: 8px;
}

.activity-item:last-child {
    border-bottom: none;
}

.activity-item:hover {
    background: var(--bg-tertiary);
}

.activity-icon {
    width: 36px;
    height: 36px;
    min-width: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 50%;
    font-size: 0.85rem;
}

.activity-content {
    flex: 1;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: nowrap;
    min-width: 0;
}

.activity-content p {
    flex: 1;
    min-width: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}



.activity-content .text-secondary {
    color: var(--text-secondary);
}

.activity-ticket-link {
    color: var(--accent-blue);
    font-weight: 600;
    font-size: 0.85rem;
    margin-left: 0.5rem;
    white-space: nowrap;
}

.activity-ticket-link:hover {
    color: var(--accent-cyan);
}

.activity-time {
    color: var(--text-muted);
    font-size: 0.8rem;
    white-space: nowrap;
}

/* Activity Feed Responsive */
@media (max-width: 768px) {
    .activity-content {
        flex-direction: column;
        align-items: flex-start;
    }

    .activity-time {
        margin-top: 0.25rem;
    }
}

/* ---------------------------------- */
/* --- CHANGELOG PAGE --- */
/* ---------------------------------- */
.changelog-timeline {
    position: relative;
    margin-top: 2rem;
    padding-left: 2.5rem;
}

.changelog-timeline::before {
    content: '';
    position: absolute;
    left: 18px;
    top: 0;
    bottom: 0;
    width: 2px;
    background: var(--border-color);
}

.changelog-entry {
    position: relative;
    margin-bottom: 2rem;
}

.changelog-entry:last-child {
    margin-bottom: 0;
}

.changelog-marker {
    position: absolute;
    left: -2.5rem;
    top: 1.4rem;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: var(--bg-main);
    border: 2px solid var(--accent-blue);
    font-size: 0.85rem;
    z-index: 1;
}

.changelog-entry.latest .changelog-marker {
    box-shadow: 0 0 12px rgba(30, 136, 229, 0.4);
}

.changelog-card {
    padding: 1.5rem;
}

.changelog-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}

.changelog-version {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--text-primary);
    font-family: 'Inter', monospace;
}

.changelog-latest-badge {
    display: inline-block;
    padding: 0.15rem 0.6rem;
    background: linear-gradient(135deg, var(--accent-blue), #1565c0);
    color: #fff;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
    margin-left: 0.5rem;
    vertical-align: middle;
}

.changelog-date {
    color: var(--text-muted);
    font-size: 0.85rem;
}

.changelog-date i {
    margin-right: 0.3rem;
}

.changelog-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 1rem;
}

.changelog-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

.changelog-list li {
    color: var(--text-secondary);
    font-size: 0.92rem;
    line-height: 1.5;
    display: flex;
    align-items: flex-start;
    gap: 0.6rem;
}

.change-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.1rem 0.5rem;
    border-radius: 4px;
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    white-space: nowrap;
    min-width: 56px;
    justify-content: center;
    flex-shrink: 0;
    margin-top: 0.15rem;
}

.change-new {
    background: rgba(76, 175, 80, 0.15);
    color: #66bb6a;
    border: 1px solid rgba(76, 175, 80, 0.3);
}

.change-fix {
    background: rgba(245, 158, 11, 0.15);
    color: #f59e0b;
    border: 1px solid rgba(245, 158, 11, 0.3);
}

.change-improvement {
    background: rgba(30, 136, 229, 0.15);
    color: var(--accent-blue);
    border: 1px solid rgba(30, 136, 229, 0.3);
}

/* --- Footer Changelog Link --- */
.changelog-link {
    display: inline-flex;
    align-items: center;
    color: var(--accent-blue);
    text-decoration: none;
    transition: color 0.15s ease;
}

.changelog-link svg {
    margin-left: 5px;
    width: 0.8em;
    height: 0.8em;
    transition: transform 0.15s ease, color 0.15s ease;
}

.changelog-link:hover {
    color: var(--accent-cyan);
}

.changelog-link:hover svg {
    color: var(--accent-cyan);
    transform: translateY(-2px);
}

/* Changelog Responsive */
@media (max-width: 768px) {
    .changelog-timeline {
        padding-left: 2rem;
    }

    .changelog-marker {
        left: -2rem;
        width: 30px;
        height: 30px;
        font-size: 0.75rem;
    }

    .changelog-header {
        flex-direction: column;
        align-items: flex-start;
    }
}

/* =============================================
   MARKDOWN IN COMMENTS
   ============================================= */
.comment-text-content {
    line-height: 1.6;
    word-wrap: break-word;
}

.comment-text-content p {
    margin: 0 0 0.5rem 0;
}

.comment-text-content p:last-child {
    margin-bottom: 0;
}

.comment-text-content strong {
    font-weight: 600;
    color: var(--text-primary);
}

.comment-text-content code {
    background: var(--bg-primary);
    color: var(--accent-cyan);
    padding: 0.15rem 0.4rem;
    border-radius: 4px;
    font-family: 'Courier New', monospace;
    font-size: 0.9em;
}

.comment-text-content pre {
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 1rem;
    overflow-x: auto;
    margin: 0.75rem 0;
}

.comment-text-content pre code {
    background: none;
    padding: 0;
    color: var(--text-primary);
}

.comment-text-content blockquote {
    border-left: 3px solid var(--accent-blue);
    margin: 0.75rem 0;
    padding: 0.5rem 1rem;
    background: rgba(59, 130, 246, 0.08);
    border-radius: 0 6px 6px 0;
    color: var(--text-secondary);
}

.comment-text-content ul,
.comment-text-content ol {
    margin: 0.5rem 0;
    padding-left: 1.5rem;
}

.comment-text-content li {
    margin-bottom: 0.25rem;
}

.comment-text-content table {
    border-collapse: collapse;
    width: 100%;
    margin: 0.75rem 0;
}

.comment-text-content th,
.comment-text-content td {
    border: 1px solid var(--border-color);
    padding: 0.5rem 0.75rem;
    text-align: left;
}

.comment-text-content th {
    background: var(--bg-primary);
    font-weight: 600;
}

.comment-text-content a {
    color: var(--accent-blue);
    text-decoration: none;
}

.comment-text-content a:hover {
    text-decoration: underline;
}

.comment-text-content img {
    max-width: 100%;
    border-radius: 8px;
}

/* =============================================
   @MENTIONS
   ============================================= */
.mention {
    display: inline-block;
    background: rgba(59, 130, 246, 0.15);
    color: var(--accent-blue);
    padding: 0.1rem 0.5rem;
    border-radius: 12px;
    font-weight: 600;
    font-size: 0.9em;
}

.mention-self {
    background: rgba(16, 185, 129, 0.2);
    color: var(--status-green);
    animation: mentionPulse 2s ease-in-out;
}

@keyframes mentionPulse {

    0%,
    100% {
        box-shadow: none;
    }

    50% {
        box-shadow: 0 0 8px rgba(16, 185, 129, 0.4);
    }
}

/* =============================================
   DRAG & DROP UPLOAD
   ============================================= */
.drop-zone {
    border: 2px dashed var(--border-color);
    border-radius: 12px;
    padding: 1.5rem;
    text-align: center;
    transition: all 0.3s ease;
    cursor: pointer;
    position: relative;
}

.drop-zone-prompt {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-secondary);
    pointer-events: none;
}

.drop-zone-prompt i {
    font-size: 2rem;
    opacity: 0.5;
}

.drop-zone-prompt span {
    font-size: 0.9rem;
}

.drop-zone.dragover {
    border-color: var(--accent-blue);
    background: rgba(59, 130, 246, 0.08);
    box-shadow: 0 0 20px rgba(59, 130, 246, 0.15);
}

.drop-zone.dragover .drop-zone-prompt {
    color: var(--accent-blue);
}

.drop-zone.dragover .drop-zone-prompt i {
    opacity: 1;
}

.drop-zone-preview {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-top: 1rem;
}

.drop-zone-thumb {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
    width: 80px;
}

.drop-zone-thumb img {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

.drop-zone-thumb span {
    font-size: 0.7rem;
    color: var(--text-secondary);
    text-align: center;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    width: 100%;
}

/* =============================================
   RELATED TICKETS
   ============================================= */
.related-tickets-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-top: 0.75rem;
}

.related-ticket-badge {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.75rem;
    background: var(--bg-tertiary);
    border-radius: 8px;
    border: 1px solid var(--border-color);
    text-decoration: none;
    color: var(--text-primary);
    transition: all 0.2s ease;
    font-size: 0.85rem;
}

.related-ticket-badge:hover {
    background: var(--bg-primary);
    border-color: var(--accent-blue);
    transform: translateX(4px);
}

.related-ticket-badge .ticket-num {
    color: var(--accent-blue);
    font-weight: 600;
    white-space: nowrap;
}

.related-ticket-badge .ticket-title {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: var(--text-secondary);
}

.related-ticket-badge .unlink-btn {
    margin-left: auto;
    color: var(--text-muted);
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.2s ease, color 0.2s ease;
    background: none;
    border: none;
    padding: 0.25rem;
}

.related-ticket-badge:hover .unlink-btn {
    opacity: 1;
}

.related-ticket-badge .unlink-btn:hover {
    color: var(--status-red);
}

.related-search-form {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.75rem;
}

.related-search-form input {
    flex: 1;
    min-width: 0;
}

.related-search-form button {
    white-space: nowrap;
}

/* =============================================
   FLOATING TOOLBAR & LIVE PREVIEW
   ============================================= */
.floating-toolbar {
    position: absolute;
    display: flex;
    gap: 0.25rem;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    padding: 0.25rem;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    z-index: 1000;
    pointer-events: auto;
    animation: fadeIn 0.15s ease-out;
}

.floating-toolbar button {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    width: 30px;
    height: 30px;
    border-radius: 4px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.floating-toolbar button:hover {
    background: var(--bg-primary);
    color: var(--text-primary);
}

.floating-toolbar button.active {
    color: var(--accent-blue);
    background: rgba(59, 130, 246, 0.1);
}

/* =============================================
   INTEGRATED EDITOR & FLOATING TOOLBAR
   ============================================= */
.editor-wrapper {
    position: relative;
    width: 100%;
}

.editor-wrapper textarea {
    position: relative;
    z-index: 2;
    background: transparent !important;
    color: transparent !important;
    caret-color: var(--text-primary);
    overflow: auto;
    /* Scrollbar on textarea */
    resize: vertical;
    min-height: 120px;
}

.editor-highlights {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    padding: 0.75rem;
    border: 1px solid transparent;
    color: var(--text-primary);
    background: var(--bg-secondary);
    border-radius: 8px;
    overflow-y: scroll;
    /* Force scrollbar space to match textarea */
    scrollbar-width: none;
    /* Hide scrollbar Firefox */
    white-space: pre-wrap;
    word-wrap: break-word;
    font-family: 'Inter', sans-serif;
    font-size: 1rem;
    line-height: 1.5;
    pointer-events: none;
}

/* Hide scrollbar for Chrome/Safari/Edge */
.editor-highlights::-webkit-scrollbar {
    display: none;
}

/* Specific styling for highlights in the editor */
.editor-highlights .md-syntax {
    color: var(--text-muted);
    font-weight: normal;
}

.editor-highlights .md-bold {
    color: var(--status-yellow);
    font-weight: normal;
}

.editor-highlights .md-italic {
    color: var(--accent-blue);
    font-style: normal;
}

.editor-highlights .md-code {
    background: rgba(47, 49, 54, 0.5);
    color: var(--text-primary);
    border-radius: 3px;
    font-family: 'Inter', sans-serif;
    font-size: 1rem;
    padding: 0;
}

.editor-highlights .md-strike {
    text-decoration: line-through;
    color: var(--text-muted);
}

.editor-highlights .mention {
    display: inline;
    padding: 0 2px;
}

/* Floating Toolbar */
.floating-toolbar {
    position: absolute;
    display: flex;
    gap: 0.25rem;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    padding: 0.25rem;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    z-index: 1000;
    pointer-events: auto;
    /* Clickable */
    animation: fadeIn 0.15s ease-out;
}

.floating-toolbar button {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    width: 30px;
    height: 30px;
    border-radius: 4px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.floating-toolbar button:hover {
    background: var(--bg-primary);
    color: var(--text-primary);
}

/* Ensure textarea styles match highlights exactly */
textarea {
    font-family: 'Inter', sans-serif;
    font-size: 1rem;
    line-height: 1.5;
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: 8px;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(5px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}



/* ========================================= */
/* --- DEPARTMENT HUB STYLES (MATCHING TICKET SYSTEM) --- */
/* ========================================= */

/* --- Hero Section --- */
.page-header.hub-hero {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    padding: 2.5rem 2rem;
    text-align: left;
    /* Align text left like "Team-Dashboard" */
    position: relative;
    overflow: hidden;
    border-radius: 12px;
    /* Standard rounded corners */
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    margin-bottom: 2rem !important;
}

.page-header.hub-hero::before,
.page-header.hub-hero::after {
    display: none;
}

.page-header.hub-hero h1 {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-primary);
    background: none;
    -webkit-text-fill-color: initial;
    margin-bottom: 0.5rem;
    text-shadow: none;
}

.page-header.hub-hero p {
    font-size: 1rem;
    color: var(--text-secondary);
    opacity: 1;
    margin: 0;
    max-width: none;
}

/* --- Department Grid Layout --- */
.departments-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    /* Slightly smaller cards */
    gap: 1.5rem;
    padding: 0;
}

/* --- Department Card --- */
.department-card {
    background: var(--bg-secondary);
    /* Solid dark background */
    border: 1px solid var(--border-color);
    border-radius: 12px;
    overflow: hidden;
    transition: transform 0.2s ease, border-color 0.2s ease;
    display: flex;
    flex-direction: column;
    position: relative;
    backdrop-filter: none;
    /* Remove glass effect */
    height: 100%;
}

.department-card::before {
    display: none;
    /* Remove border gradient */
}

.department-card:hover {
    transform: translateY(-4px);
    border-color: var(--accent-blue);
    /* Only border highlights on hover */
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    background: var(--bg-secondary);
}

.department-card:hover .dept-icon-wrapper {
    transform: none;
    /* Remove icon rotation */
    box-shadow: none;
}

/* Header Area with Icon */
.dept-header {
    padding: 2rem 1.5rem 1rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    background: transparent;
    /* Remove header gradient */
    border-bottom: none;
}

.dept-icon-wrapper {
    width: 64px;
    height: 64px;
    border-radius: 12px;
    /* Squarer rounding */
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1rem;
    font-size: 2rem;
    box-shadow: none;
    position: relative;
    transition: none;
    background: rgba(255, 255, 255, 0.05);
    /* Default subtle background */
    color: var(--text-primary);
}

.dept-name {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
    line-height: 1.4;
}

.dept-head {
    font-size: 0.8rem;
    color: var(--text-secondary);
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    background: rgba(255, 255, 255, 0.03);
    padding: 0.25rem 0.75rem;
    border-radius: 6px;
    border: 1px solid var(--border-color);
}

/* Body Area */
.dept-body {
    padding: 1rem 1.5rem 1.5rem;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.dept-short-desc {
    color: var(--text-secondary);
    text-align: center;
    margin-bottom: 1.5rem;
    font-size: 0.9rem;
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Action Button */
.btn-dept-action {
    width: 100%;
    justify-content: center;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    padding: 0.75rem;
    border-radius: 8px;
    font-weight: 500;
    transition: all 0.2s ease;
    font-size: 0.9rem;
}

.btn-dept-action:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
    border-color: var(--text-muted);
    transform: none;
    box-shadow: none;
}

/* --- Dept Detail Modal --- */
.dept-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
}

.dept-modal-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.dept-modal-content {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    width: 100%;
    max-width: 600px;
    max-height: 85vh;
    overflow-y: auto;
    position: relative;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    transform: scale(0.98);
    transition: transform 0.2s ease;
}

.dept-modal-overlay.active .dept-modal-content {
    transform: scale(1);
}

.dept-modal-header {
    background: var(--bg-tertiary);
    padding: 1.5rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    gap: 1.25rem;
}

.dept-modal-close {
    position: absolute;
    top: 1.25rem;
    right: 1.25rem;
    background: transparent;
    border: none;
    width: 32px;
    height: 32px;
    border-radius: 6px;
    color: var(--text-muted);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    font-size: 1.1rem;
}

.dept-modal-close:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-primary);
}

.dept-modal-body {
    padding: 1.5rem;
    color: var(--text-secondary);
    line-height: 1.6;
    font-size: 0.95rem;
}

/* --- Slideshow Styles --- */
.slideshow-container {
    position: relative;
    margin: auto;
}

.mySlides {
    display: none;
}

.prev,
.next {
    cursor: pointer;
    position: absolute;
    top: 50%;
    width: auto;
    margin-top: -22px;
    padding: 16px;
    color: white;
    font-weight: bold;
    font-size: 18px;
    transition: 0.6s ease;
    border-radius: 0 3px 3px 0;
    user-select: none;
    background-color: rgba(0, 0, 0, 0.3);
}

.next {
    right: 0;
    border-radius: 3px 0 0 3px;
}

.prev:hover,
.next:hover {
    background-color: rgba(0, 0, 0, 0.8);
}

.fade {
    animation-name: fade;
    animation-duration: 1.5s;
}

@keyframes fade {
    from {
        opacity: .4
    }

    to {
        opacity: 1
    }
}


/* ---------------------------------- */
/* --- ADMIN DASHBOARD --- */
/* ---------------------------------- */
.dashboard-grid {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 1.5rem;
    margin-top: 2rem;
}

.dashboard-sidebar .glass-container {
    padding: 1.5rem;
}

/* Sticky Sidebar on larger screens */
@media (min-width: 993px) {
    .dashboard-sidebar {
        position: sticky;
        top: 2rem;
        height: fit-content;
        max-height: calc(100vh - 4rem);
        overflow-y: auto;
        /* Scrollbar styling for sidebar if needed */
        scrollbar-width: thin;
    }
}

.admin-nav-list li {
    margin-bottom: 0.5rem;
}

.admin-nav-list .btn {
    text-align: left;
    justify-content: flex-start;
    padding: 0.75rem 1rem;
    border: 1px solid transparent;
}

.admin-nav-list .btn:hover,
.admin-nav-list .btn.active {
    background: rgba(59, 130, 246, 0.1);
    border-color: var(--accent-blue);
    color: var(--text-primary);
}

.admin-nav-list .btn i {
    width: 24px;
    text-align: center;
    margin-right: 0.5rem;
}

/* Admin Dashboard Stats Cards */
/* Scoped to avoid conflict */
.dashboard-grid .stat-card {
    display: flex;
    align-items: center;
    padding: 1.5rem;
    gap: 1.25rem;
    height: 100%;
}

.dashboard-grid .stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1rem;
}

.stat-icon {
    width: 56px;
    height: 56px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.75rem;
    flex-shrink: 0;
}

.stat-info {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.stat-value {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.1;
}

.stat-label {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-top: 0.25rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Responsive Dashboard Layout */
@media (max-width: 992px) {
    .dashboard-grid {
        grid-template-columns: 1fr;
    }
}

/* ---------------------------------- */
/* --- UPLOAD MODAL --- */
/* ---------------------------------- */
.upload-modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(8px);
    justify-content: center;
    align-items: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.upload-modal.active {
    display: flex;
    opacity: 1;
}

.upload-modal-content {
    background: rgba(24, 26, 31, 0.95);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 20px;
    padding: 2.5rem;
    width: 90%;
    max-width: 500px;
    text-align: center;
    position: relative;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    transform: scale(0.95);
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.upload-modal.active .upload-modal-content {
    transform: scale(1);
}

.close-modal-btn {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.25rem;
    cursor: pointer;
    transition: color 0.2s;
}

.close-modal-btn:hover {
    color: var(--text-primary);
}

.upload-drop-area {
    border: 2px dashed rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    padding: 3rem 1.5rem;
    margin: 1.5rem 0;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    background: rgba(255, 255, 255, 0.02);
}

.upload-drop-area:hover,
.upload-drop-area.drag-over {
    border-color: var(--accent-blue);
    background: rgba(59, 130, 246, 0.08);
    transform: translateY(-2px);
}

.upload-drop-area i {
    font-size: 3rem;
    color: var(--text-muted);
    margin-bottom: 1rem;
    transition: color 0.3s;
}

.upload-drop-area:hover i,
.upload-drop-area.drag-over i {
    color: var(--accent-blue);
}

.file-list-preview {
    text-align: left;
    max-height: 150px;
    overflow-y: auto;
    margin-bottom: 1.5rem;
    padding-right: 0.5rem;
}

.file-preview-item {
    background: rgba(255, 255, 255, 0.03);
    padding: 0.75rem 1rem;
    border-radius: 8px;
    margin-bottom: 0.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.file-preview-item .file-name {
    font-size: 0.9rem;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 80%;
}

.file-preview-item .file-remove {
    color: var(--status-red);
    cursor: pointer;
    font-size: 0.9rem;
    padding: 0.25rem;
}

.btn-icon-large {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-secondary);
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: all 0.2s;
    cursor: pointer;
}

.btn-icon-large:hover {
    background: var(--bg-tertiary);
    color: var(--accent-blue);
    border-color: var(--accent-blue);
}

.selected-files-count {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-left: 0.75rem;
    background: rgba(255, 255, 255, 0.05);
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

/* --- Member List Styles --- */
.member-list-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1rem;
    max-height: 300px;
    overflow-y: auto;
    padding-right: 0.5rem;
}

.member-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    transition: background 0.2s;
}

.member-card:hover {
    background: rgba(255, 255, 255, 0.07);
}

.member-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--bg-tertiary);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    font-size: 0.9rem;
}

.member-info {
    display: flex;
    flex-direction: column;
}

.member-name {
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--text-primary);
}

.member-rank {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

/* Custom Scrollbar for inner modal lists */
.member-list-grid::-webkit-scrollbar {
    width: 6px;
}

.member-list-grid::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.1);
}

.member-list-grid::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 3px;
}

.member-list-grid::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

/* --- Admin Panel & Premium Member List --- */
.admin-layout .dropdown-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    color: var(--text-primary);
    text-decoration: none;
    transition: background 0.2s;
}

.admin-layout .dropdown-item:hover {
    background: rgba(255, 255, 255, 0.05);
}

.dept-icon-large {
    width: 64px;
    height: 64px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    color: #fff;
}

.member-grid-premium {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
    animation: fadeIn 0.5s ease;
}

.member-card-premium {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    overflow: hidden;
    padding: 0 !important;
    /* Reset standard padding */
    transition: transform 0.3s, box-shadow 0.3s;
    position: relative;
    border: 1px solid var(--border-color);
}

.member-card-premium:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.member-header-bg {
    width: 100%;
    height: 60px;
    opacity: 0.3;
}

.card-content {
    padding: 0 1.5rem 1.5rem;
    width: 100%;
    margin-top: -30px;
    /* Pull avatar up */
    display: flex;
    flex-direction: column;
    align-items: center;
}

.avatar-wrapper {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    border: 3px solid var(--bg-secondary);
    background: var(--bg-secondary);
    overflow: hidden;
    margin-bottom: 1rem;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
}

.real-avatar {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.default-avatar {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--glass-bg);
    color: var(--text-muted);
    font-size: 2rem;
}

.member-name {
    font-size: 1.1rem;
    margin-bottom: 0.25rem;
    color: var(--text-primary);
}

.member-rank {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 20px;
    font-size: 0.85rem;
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
}

.card-actions {
    margin-top: 1rem;
    opacity: 0;
    transition: opacity 0.3s;
}

.member-card-premium:hover .card-actions {
    opacity: 1;
}

.btn-icon {
    color: var(--text-muted);
    font-size: 1.2rem;
    transition: color 0.2s;
}

.btn-icon:hover {
    color: var(--accent-color);
}

.error-box {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid var(--status-red);
    color: var(--status-red);
    padding: 1rem;
    border-radius: 8px;
    text-align: center;
}

.empty-state {
    text-align: center;
    padding: 4rem;
    color: var(--text-muted);
    font-size: 1.2rem;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid var(--border-color);
    border-top: 4px solid var(--accent-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

/* --- Stats Cards (Ticket System Style) --- */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-card-premium {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 1.5rem;
    position: relative;
    overflow: hidden;
    transition: transform 0.3s, box-shadow 0.3s;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-height: 140px;
}

.stat-card-premium:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    border-color: var(--accent-blue);
}


.stat-icon-wrapper {
    margin-bottom: 0.5rem;
    font-size: 1.8rem;
    /* Removed fixed width/height/background to match reference */
    display: inline-flex;
    align-items: center;
    justify-content: start;
}

/* Colors for specific icons (text color only) */
.stat-icon-blue {
    color: #3b82f6;
}

.stat-icon-green {
    color: #10b981;
}

.stat-icon-purple {
    color: #a855f7;
}

.stat-icon-orange {
    color: #f97316;
}

.stat-value {
    font-size: 2.2rem;
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: 0.25rem;
    color: #fff;
    font-family: 'Inter', sans-serif;
    /* Ensure clean font */
}

.stat-label {
    font-size: 0.9rem;
    color: var(--text-secondary);
    font-weight: 500;
}