body {
    margin: 0;
    min-height: 100vh;
    font-family: 'Montserrat', Arial, Helvetica, sans-serif;
    background: #fff;
    overflow-x: hidden; /* Prevent horizontal scroll on body */
}

/* Sidebar: straight green bar */
.sidebar {
    position: fixed;
    left: 0; top: 0; bottom: 0;
    width: 420px;
    min-height: 100vh;
    background: #00403A;
    z-index: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* Logo on sidebar, correctly positioned and not stretched */
.sidebar-logo {
    margin: 40px;
    /* No background, no box */
}
.sidebar-logo img {
    max-width: 250px;
    height: auto;
    width: 100%;
    display: block;
}

.landing-label {
    background: yellow;
    color: #000;
    font-size: 18px;
    padding: 5px 30px 5px 10px;
    position: absolute;
    left: 0;
    top: 0;
    border-radius: 0 0 0.6em 0;
}

.main-content {
    margin-left: 420px;
    display: flex;
    flex-direction: column;
    align-items: center;
    min-height: 100vh;
    justify-content: center;
}

.headline {
    color: #00403A;
    font-size: 2.6rem;
    font-weight: bold;
    margin-top: 70px;
    margin-bottom: 18px;
    text-align: center;
}
.headline strong {
    text-decoration: underline;
}

.desc {
    color: #00403A;
    font-size: 1.35rem;
    margin-bottom: 30px;
    text-align: center;
    font-weight: 400;
}

.login-box {
    background:#7A9593;
    color: #fff;
    border-radius: 32px;
    padding: 28px 46px 24px 36px;
    width: 330px;
    margin: 0 auto;
    box-sizing: border-box;
    margin-bottom: 14px;
    box-shadow: 0 3px 12px rgba(3,73,70,0.08);
}
.login-box h2 {
    font-size: 1.3em;
    font-weight: 500;
    margin: 0 0 14px 0;
    display: flex;
    align-items: center;
    gap: 10px;
}
.login-box h2 i {
    font-size: 1.5em;
    margin-right: 10px;
}
.login-box input {
    width: 93%;
    padding: 9px 13px;
    margin: 7px 0 13px 0;
    border-radius: 7px;
    border: none;
    font-size: 1em;
    font-family: inherit;
    background: #eaf4f3;
    color: #034946;
}
.login-box input:focus {
    outline: 2px solid #009e63;
}
.login-box button {
    width: 100%;
    background: #00403A;
    color: #fff;
    font-size: 1.2em;
    padding: 11px 0;
    border: none;
    border-radius: 8px;
    margin-top: 5px;
    font-family: inherit;
    cursor: pointer;
    font-weight: 600;
}
.login-box .login-links {
    margin-top: 11px;
    font-size: 1em;
}
.login-box .login-links a {
    color: #fff;
    text-decoration: underline;
    display: block;
    margin-bottom: 5px;
    margin-left: 15px;
}
.other-links {
    text-align: left;
    margin-top: 10px;
    font-size: 1em;
    color: #034946;
}
.other-links a {
    color: #034946;
    text-decoration: underline;
    display: block;
    margin-bottom: 3px;
}
.login-failed {
    color: #d8000c;
    background: #fff6f6;
    border-left: 4px solid #d8000c;
    padding: 6px 11px;
    border-radius: 6px;
    margin-bottom: 12px;
}

@media (max-width: 768px) {
    .sidebar { display: none; }
    .main-content { margin-left: 0; }
}


/* Main dashboard area overrides */

.dashboard-flex {
    display: flex;
    min-height: 100vh;
    width: 100vw;
    overflow-x: hidden;
}

.dashboard-sidebar {
    width: 320px;
    background: #fff;
    border-right: 1px solid #e6e6e6;
    display: flex;
    flex-direction: column;
    align-items: center;
    min-height: 100vh;
    flex-shrink: 0;
}

.sidebar-menu {
    width: 100%;
    margin-top: 30px;
    margin-bottom: 36px;
    text-align: left;
    padding-left: 130px;
}

.sidebar-link {
    display: block;
    font-size: 1.16em;
    color: #04413A;
    text-decoration: none;
    font-weight: 700;
    padding: 5px 0;
    margin-bottom: 10px;
}

.sidebar-link span {
    float: right;
    color: #04413A;
}
.sidebar-link:hover {
    text-decoration: underline;
}
.sidebar-user {
    margin-top: auto;
    padding-left: 130px;
    color: #0d5650;
    font-size: 1em;
    width: 100%;
}
.sidebar-username { font-weight: 700; margin-bottom: 12px; }

.sidebar-logout {
    color: #0d5650;
    text-decoration: none;
    display: block;
    margin-top: 8px;
    font-size: 1em;
}

.dashboard-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.dashboard-topbar {
    background: #00403A;
    font-family: 'Montserrat', Arial, Helvetica, sans-serif;
    color: #fff;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 32px 58px 24px 54px;
    position: relative;
    min-height: 78px;
}

.dashboard-content {
    flex: 1;
    background: #f6f6f6;
    font-family: 'Montserrat', Arial, Helvetica, sans-serif;
    min-height: 100vh;
    padding: 36px 32px 0 32px;
}

/* ppt */

.ppt-upload-section {
    display: flex;
    gap: 32px;
    align-items: flex-start;
    margin-top: 40px;
    font-family: 'Montserrat', Arial, Helvetica, sans-serif;
    flex-wrap: wrap;
}
.upload-col {
    width: 280px;
    text-align: center;
    flex: 0 0 auto;
}
.upload-box {
    background: #E5FFD6;
    border-radius: 30px;
    padding: 20px 18px;
    margin-bottom: 22px;
    font-size: 1.08em;
    cursor: pointer;
    font-weight: 500;
    color: #04413A;
    transition: background 0.18s;
    height: 170px;
    width: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    box-sizing: border-box;
}
.upload-box:hover {
    background: #d5ffbe;
}
.upload-icon {
    font-size: 3em;
    margin-bottom: 12px;
}
.upload-icon .material-symbols-outlined { font-size: 100px; line-height: 1; display: block; color: #04413A; }
.upload-info {
    font-size: 0.97em;
    color: #04413A;
}
.upload-info a {
    color: #04413A;
    text-decoration: underline;
}
.files-col {
    flex: 1 1 400px; /* grow to fill space, min 400px */
    max-width: 900px;
    margin-left: 0;
}
.files-header {
    display: grid;
    grid-template-columns: auto 130px; /* Name | status/tick */
    grid-auto-rows: auto;
    column-gap: 32px; /* match left gap to upload box */
    row-gap: 6px;
    align-items: center;
    font-size: 1.2em;
    font-weight: 700;
    color: #01766c;
    margin-bottom: 8px;
}
.status-title {
    min-width: 130px;
}
.files-list {
    display: grid;
    grid-template-columns: 1fr 130px; /* let name span remaining space; wider status column */
    column-gap: 32px;
    row-gap: 8px;
    margin-top: 0;
}
.file-row {
    display: contents;
    font-size: 1.08em;
    color: #04413A;
}
.file-name { min-width: 0; overflow-wrap: anywhere; word-break: break-word; }
.file-status {
    min-width: 130px;
    color: #01766c;
    font-size: 1.08em;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    padding-left: 8px;
}
.file-checked {
    color: #39cc47;
    font-size: 1.08em;
    font-weight: 500;
}
.no-files {
    color: #04413A;
    font-size: 1.09em;
}
.files-list .no-files { grid-column: 1 / -1; }
.status-dots {
    color: #01766c;
    margin-left: 18px;
}
.files-header .status-title {
    width: auto;
    white-space: nowrap;
}
.check-col {
    width: 220px;
    display: flex;
    align-items: center;
    justify-content: flex-end;
}
.files-header #ci-start-btn,
.files-list #ci-start-btn,
.files-col #ci-start-btn { display: none; }

.action-col { 
    width: 280px; 
    flex: 0 0 auto;
    display: flex;
    justify-content: center;
}
.action-col #ci-start-btn { 
    width: 100%; 
    height: 170px; 
    margin-left: 0;
}
.ci-check-btn {
    width: 100%;
    height: 170px;
    background: #90ff38;
    border: none;
    margin-left: 0;
    border-radius: 30px;
    box-shadow: 0 2px 12px 0 #007e6856;
    font-size: 1.25em;
    font-weight: 700;
    color: #04413A;
    text-align: center;
    cursor: pointer;
    transition: background 0.18s;
    box-sizing: border-box;
    display: flex;
    align-items: center;
    justify-content: center;
}
.ci-check-btn:hover {
    background: #abff69;
}

/* inline, compact variant used in header */
.ci-inline-btn {
    width: auto;
    height: auto;
    padding: 10px 16px;
    border-radius: 10px;
    box-shadow: none;
}

.ppt-header {
    font-weight: bold;
    font-family: 'Montserrat', Arial, Helvetica, sans-serif;
    color: #04413A;
}

/* Report layout */
.report-grid {
    display: grid;
    grid-template-columns: 1fr 320px;
    column-gap: 24px;
    align-items: start;
    margin-top: 30px;
    max-width: 100%;
    overflow: hidden;
}

/* Responsive report layout */
@media (max-width: 1200px) {
    .report-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    .report-right {
        order: -1; /* Move download box to top on smaller screens */
    }
}

.report-left h3 {
    margin-top: 25px;
    margin-bottom: 25px;
    font-size: 0.95em;
    font-weight: 400;
    color: #04413A;
}

.report-left ul {
    margin-top: 15px;
}

.report-left li {
    margin-bottom: 15px;
    word-wrap: break-word;
    word-break: break-word;
    overflow-wrap: break-word;
    line-height: 1.5;
    list-style-position: outside;
    max-width: 100%;
    overflow: hidden;
    display: flex;
    align-items: flex-start;
    gap: 8px;
    padding-left: 0;
}

/* Ensure download arrows stay close to filenames */
.report-left li span {
    flex: 1;
    min-width: 0; /* Allow shrinking */
}

.report-left li a {
    flex-shrink: 0;
    font-size: 24px !important;
    font-weight: bold !important;
    color: #666666 !important;
    text-decoration: none !important;
    padding: 4px 8px !important;
    background-color: #e0e0e0 !important;
    border-radius: 4px !important;
    border: 1px solid #cccccc !important;
    transition: all 0.3s ease !important;
    display: inline-block !important;
    text-align: center !important;
    min-width: 30px !important;
}

.report-left li a:hover {
    background-color: #cccccc !important;
    color: #333333 !important;
    transform: scale(1.05) !important;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2) !important;
}
.report-right .ci-check-btn {
    width: 100%;
    height: 170px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 14px;
    text-decoration: none;
}
.report-right .ci-check-btn .material-symbols-outlined { font-size: 64px; }
.zip-card {
    background: #E5FFD6;
    display: flex;
    width: 100%;
    height: 170px;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    text-decoration: none;
    box-shadow: 0 2px 12px 0 #007e6856;
    border-radius: 30px;
}
.zip-card:hover { background: #d5ffbe; }
.zip-card .material-symbols-outlined { font-size: 64px; color: #04413A; }
.download-label {
    color: #04413A;
    font-weight: 700;
    text-align: center;
    word-wrap: break-word;
    word-break: break-word;
    overflow-wrap: break-word;
    line-height: 1.3;
    padding: 0 10px;
}
.report-tile-title {
    font-weight: 700;
    color: #01766c;
    margin-bottom: 10px;
}
.download-box {
    display: flex;
    align-items: center;
    gap: 8px;
}
.material-symbols-outlined {
    font-variation-settings:
      'FILL' 0,
      'wght' 400,
      'GRAD' 0,
      'opsz' 24;
}

/* Production-Ready Responsive History Table */
#history-container { 
    margin-top: 40px; 
    padding: 0;
    margin: 40px 0 0 0;
    overflow-x: auto !important;
    overflow-y: visible !important;
    -webkit-overflow-scrolling: touch;
    width: 100% !important;
    max-width: 100% !important;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    /* Force scrollbar visibility - ONLY on table container */
    scrollbar-width: auto !important;
    scrollbar-color: #04413A #f1f1f1 !important;
    /* Prevent body scroll */
    position: relative;
    contain: layout;
    /* Ensure container can scroll */
    display: block !important;
    /* Force scrollbar to always be visible */
    min-height: 200px;
}

#history-table {
    margin: 0 !important;
    width: 1400px !important; /* Fixed width - always wider than container */
    min-width: 1400px !important; /* Minimum width for scroll */
    table-layout: auto !important; /* Auto layout for better responsiveness */
    border-collapse: separate !important;
    border-spacing: 0 !important;
    /* Ensure table doesn't break layout */
    display: table !important;
    /* Force table to be wider than container */
    white-space: nowrap !important;
}

/* Responsive column widths - more flexible */
#history-table th:nth-child(1), #history-table td:nth-child(1) { 
    width: 15% !important; 
    min-width: 150px !important; 
    max-width: 200px !important;
    white-space: nowrap;
} /* Datum */

#history-table th:nth-child(2), #history-table td:nth-child(2) { 
    width: 10% !important; 
    min-width: 100px !important; 
    max-width: 150px !important;
    text-align: center;
} /* Download */

#history-table th:nth-child(3), #history-table td:nth-child(3) { 
    width: 25% !important; 
    min-width: 250px !important; 
    max-width: 400px !important;
    word-wrap: break-word;
    word-break: break-word;
} /* Files */

#history-table th:nth-child(4), #history-table td:nth-child(4) { 
    width: 20% !important; 
    min-width: 200px !important; 
    max-width: 300px !important;
} /* JobID */

#history-table th:nth-child(5), #history-table td:nth-child(5) { 
    width: 15% !important; 
    min-width: 150px !important; 
    max-width: 200px !important;
    white-space: normal !important;
    word-wrap: break-word !important;
    word-break: break-word !important;
    line-height: 1.2 !important;
} /* Organisationseinheit */

#history-table th:nth-child(6), #history-table td:nth-child(6) { 
    width: 10% !important; 
    min-width: 100px !important; 
    max-width: 150px !important;
    white-space: nowrap;
} /* Typ */

#history-table th:nth-child(7), #history-table td:nth-child(7) { 
    width: 20% !important; 
    min-width: 200px !important; 
    max-width: 300px !important;
    word-wrap: break-word;
    word-break: break-word;
} /* Thema */

/* Enhanced table styling */
#history-table.table td, #history-table.table th { 
    border-right: 1px solid #cfd8d7; 
    padding: 8px 12px; 
    vertical-align: middle;
}
#history-table.table td:last-child, #history-table.table th:last-child { 
    border-right: none; 
}
#history-table.table thead th { 
    position: sticky; 
    top: 0; 
    z-index: 1; 
    background: #0b6f66; 
    color: #fff;
    font-weight: 600;
}
#history-table.table tbody tr:hover { 
    background: #eaf4f3; 
}
#history-table.table a { 
    color: #04413A; 
    text-decoration: none;
}
#history-table.table a:hover { 
    text-decoration: underline; 
}

/* Custom scrollbar styling for better visibility */
#history-container::-webkit-scrollbar {
    height: 14px;
    background: #f8f9fa;
}

#history-container::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 7px;
    border: 1px solid #e0e0e0;
}

#history-container::-webkit-scrollbar-thumb {
    background: #04413A;
    border-radius: 7px;
    border: 2px solid #f1f1f1;
    min-height: 20px;
}

#history-container::-webkit-scrollbar-thumb:hover {
    background: #03332a;
}

#history-container::-webkit-scrollbar-corner {
    background: #f1f1f1;
}

/* Force scrollbar to always be visible when content overflows */
#history-container {
    scrollbar-width: auto !important;
    scrollbar-color: #04413A #f1f1f1 !important;
}

/* Ensure table content doesn't break the layout */
#history-table {
    white-space: nowrap;
}

#history-table td, #history-table th {
    white-space: normal;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

/* Responsive breakpoints for production */
@media (max-width: 1200px) {
    #history-table th:nth-child(4), #history-table td:nth-child(4) { 
        width: 15%; 
        min-width: 120px; 
    } /* Thema - smaller on medium screens */
    #history-table th:nth-child(5), #history-table td:nth-child(5) { 
        width: 20%; 
        min-width: 150px; 
    } /* Files - smaller on medium screens */
}

@media (max-width: 768px) {
    #history-container {
        margin-top: 20px;
        border-radius: 4px;
    }
    #history-table th:nth-child(2), #history-table td:nth-child(2) { 
        display: none; 
    } /* Hide Organisationseinheit on mobile */
    #history-table th:nth-child(4), #history-table td:nth-child(4) { 
        display: none; 
    } /* Hide Thema on mobile */
    #history-table th:nth-child(5), #history-table td:nth-child(5) { 
        width: 30%; 
        min-width: 120px; 
    } /* Files - more space on mobile */
}

@media (max-width: 480px) {
    #history-table th:nth-child(6), #history-table td:nth-child(6) { 
        width: 10%; 
        min-width: 100px; 
        font-size: 0.85em;
    } /* Datum - smaller on small mobile */
    #history-table th:nth-child(5), #history-table td:nth-child(5) { 
        width: 35%; 
        min-width: 100px; 
        font-size: 0.9em;
    } /* Files - more space on small mobile */
}

/* Responsive Design for Upload Interface */

/* Large screens (1200px+) - optimal layout */
@media (min-width: 1200px) {
    .ppt-upload-section {
        gap: 40px;
    }
    .upload-col, .action-col {
        width: 300px;
    }
    .files-col {
        max-width: 1000px;
    }
}

/* Medium screens (768px - 1199px) */
@media (max-width: 1199px) and (min-width: 768px) {
    .ppt-upload-section {
        gap: 24px;
    }
    .upload-col, .action-col {
        width: 260px;
    }
    .files-col {
        flex: 1 1 350px;
        max-width: 800px;
    }
}

/* Tablet screens (768px - 1024px) */
@media (max-width: 1024px) {
    .ppt-upload-section {
        flex-direction: column;
        align-items: center;
        gap: 24px;
    }
    .upload-col, .action-col {
        width: 100%;
        max-width: 400px;
    }
    .files-col {
        width: 100%;
        max-width: none;
        flex: none;
    }
    .upload-box, .ci-check-btn {
        height: 140px;
    }
}

/* Mobile screens (under 768px) */
@media (max-width: 768px) {
    .ppt-upload-section {
        gap: 16px;
        margin-top: 20px;
    }
    .upload-col, .action-col {
        width: 100%;
        max-width: none;
    }
    .files-col {
        width: 100%;
    }
    .upload-box {
        height: 120px;
        padding: 20px 15px;
        border-radius: 20px;
    }
    .upload-icon .material-symbols-outlined {
        font-size: 60px;
    }
    .ci-check-btn {
        height: 60px;
        border-radius: 20px;
        font-size: 1.1em;
    }
    .files-header {
        grid-template-columns: 1fr;
        gap: 8px;
    }
    .files-list {
        grid-template-columns: 1fr;
        gap: 8px;
    }
    .status-title {
        text-align: center;
    }
}

/* Small mobile screens (under 480px) */
@media (max-width: 480px) {
    .dashboard-content {
        padding: 16px;
    }
    .ppt-header {
        flex-direction: column;
        gap: 16px;
    }
    .ppt-header > div {
        width: 100%;
    }
    .ppt-header select, .ppt-header input {
        width: 100%;
        min-width: auto;
    }
    .upload-box {
        height: 100px;
        font-size: 1em;
    }
    .upload-icon .material-symbols-outlined {
        font-size: 50px;
    }
    .ci-check-btn {
        height: 50px;
        font-size: 1em;
    }
}