body {
    font-family: 'Segoe UI', Arial, sans-serif;
    background: #f4f6fb;
    margin: 0;
    padding: 0;
}

.page-content {
    padding: 10px 0 0;
}

/* Logout Text Styling */
.logout-container {
    position: fixed;
    top: 5px;
    right: 10px;
    z-index: 1000;
}

.logout-text {
    font-size: 14px;
    color: #e74c3c;
    font-weight: normal;
    cursor: pointer;
    font-family: 'Segoe UI', Arial, sans-serif;
}

.logout-icon {
    font-size: 16px;
}

/* Responsive logout button for mobile devices */
@media (max-width: 768px) {
    .logout-container {
        top: 8px;
        right: 8px;
    }
    
    .logout-button {
        padding: 5px 10px;
        font-size: 11px;
    }
}

@media (max-width: 480px) {
    .logout-container {
        top: 5px;
        right: 5px;
    }
    
    .logout-button {
        padding: 4px 8px;
        font-size: 10px;
    }
}

/* Einheitliche Schriftgröße für alle Inhalte (wie Tabellen-Inhalt) */
.admin-content {
    font-size: 16px;
}

/* Labels und Texte */
.admin-label {
    font-size: 16px;
    font-weight: 500;
}

/* Input-Felder, Select-Felder, Textareas */
.admin-input {
    font-size: 16px;
}

/* Buttons */
.admin-button {
    font-size: 16px;
}



/* Modal-Inhalte (außer Headlines) */
.admin-modal-content {
    font-size: 16px;
}

/* Kleine Zusatztexte */
.admin-small-text {
    font-size: 13px;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 4px 24px rgba(0,0,0,0.08);
    padding: 32px 24px;
    overflow-x: auto;
}

h1 {
    text-align: center;
    color: #333;
    margin-bottom: 16px;
}

table {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
    table-layout: auto;
}

th, td {
    padding: 12px 10px;
    border-bottom: none;
    text-align: left;
    vertical-align: top;
    font-size: 16px;
}

/* Fixed widths for weekday columns to ensure consistency between KW and Standard tables */
.col-mo, .col-di, .col-mi, .col-do, .col-fr,
.ws-mo, .ws-di, .ws-mi, .ws-do, .ws-fr {
    width: 90px;
    min-width: 90px;
    max-width: 90px;
    word-wrap: break-word;
    overflow-wrap: break-word;
    text-align: center;
}

/* Standard column */
.col-standard {
    width: 100px;
    min-width: 100px;
    max-width: 100px;
    text-align: center;
}

/* Header cells for weekdays */
th:nth-child(5), th:nth-child(6), th:nth-child(7), th:nth-child(8), th:nth-child(9) {
    width: 90px;
    min-width: 90px;
    max-width: 90px;
    text-align: center;
}

/* Header for Standard column */
th:nth-child(4) {
    width: 100px;
    min-width: 100px;
    max-width: 100px;
    text-align: center;
}

/* Aktiv toggle column - make it smaller */
.col-aktiv, .ws-aktiv {
    width: 60px;
    min-width: 60px;
    max-width: 60px;
    text-align: center;
}

/* Header for aktiv column */
th:nth-child(2) {
    width: 60px;
    min-width: 60px;
    max-width: 60px;
    text-align: center;
}

/* Stunden column - make it smaller */
.col-stunden, .ws-stunden {
    width: 70px;
    min-width: 70px;
    max-width: 70px;
    text-align: center;
}

/* Header for stunden column */
th:nth-child(3) {
    width: 70px;
    min-width: 70px;
    max-width: 70px;
    text-align: center;
}

/* ID column - make it smaller based on max content length */
.col-id {
    width: 105px;
    min-width: 105px;
    max-width: 105px;
    text-align: center;
}

/* Email link opened styling */
.col-id.email-link-opened {
    color: #777777 !important;
    text-decoration: none !important;
    font-weight: normal !important;
}

/* Email link opened styling - but allow green highlighting for different values */
.col-id.email-link-opened.highlight-different {
    color: #4CAF50 !important;
}

/* Bold checkmark styling */
.checkmark-bold {
    font-weight: bold !important;
}

/* Header for ID column */
th:nth-child(1) {
    width: 105px;
    min-width: 105px;
    max-width: 105px;
    text-align: center;
}

/* Wochen-Standard ID column - center alignment */
#ws-clients-table th:nth-child(1) {
    width: 105px;
    min-width: 105px;
    max-width: 105px;
    text-align: center;
}

/* Wochen-Standard Aktiv column */
#ws-clients-table th:nth-child(2) {
    width: 60px;
    min-width: 60px;
    max-width: 60px;
    text-align: center;
}

/* Wochen-Standard Stunden column */
#ws-clients-table th:nth-child(3) {
    width: 70px;
    min-width: 70px;
    max-width: 70px;
    text-align: center;
}

/* Wochen-Standard weekday columns */
#ws-clients-table th:nth-child(4), #ws-clients-table th:nth-child(5), 
#ws-clients-table th:nth-child(6), #ws-clients-table th:nth-child(7), 
#ws-clients-table th:nth-child(8), #ws-clients-table th:nth-child(9) {
    width: 90px;
    min-width: 90px;
    max-width: 90px;
    text-align: center;
}

/* Wochen-Standard comment columns */
#ws-clients-table th:nth-child(10), #ws-clients-table th:nth-child(11) {
    width: auto;
    min-width: 150px;
    text-align: center;
}

#ws-clients-table td:nth-child(1) {
    text-align: center;
}

/* Kommentar columns - stretch to full width */
.col-eltern, .col-eigene {
    width: auto;
    min-width: 150px;
}

/* Headers for comment columns */
th:nth-child(10), th:nth-child(11) {
    width: auto;
    min-width: 150px;
    text-align: center;
}

/* KW Interne Kommentare Header - center alignment */
#clients-table th:nth-child(11) {
    text-align: center;
}

/* Wochen-Standard delete column */
#ws-clients-table th:nth-child(12) {
    text-align: center;
}

/* Wochen-Standard table cells - center alignment for weekdays, left alignment for emails */
#ws-clients-table .ws-mo, #ws-clients-table .ws-di, #ws-clients-table .ws-mi, 
#ws-clients-table .ws-do, #ws-clients-table .ws-fr {
    text-align: center;
}

#ws-clients-table .ws-mails {
    text-align: left;
}

/* Standard-Kommentare Spalte */
#ws-clients-table .ws-eigene-standard {
    text-align: left;
}

/* Wochen-Standard column widths - matching KW table */
#ws-clients-table .ws-id {
    width: 85px;
    min-width: 85px;
    max-width: 85px;
    text-align: center;
}

#ws-clients-table .ws-aktiv {
    width: 60px;
    min-width: 60px;
    max-width: 60px;
    text-align: center;
}

#ws-clients-table .ws-stunden {
    width: 70px;
    min-width: 70px;
    max-width: 70px;
    text-align: center;
}

#ws-clients-table .ws-mo, #ws-clients-table .ws-di, #ws-clients-table .ws-mi, 
#ws-clients-table .ws-do, #ws-clients-table .ws-fr {
    width: 90px;
    min-width: 90px;
    max-width: 90px;
    word-wrap: break-word;
    overflow-wrap: break-word;
    text-align: center;
}

#ws-clients-table .ws-mails {
    width: auto;
    min-width: 150px;
}

#ws-clients-table .ws-eltern {
    width: auto;
    min-width: 150px;
}

#ws-clients-table .ws-eigene-standard {
    width: auto;
    min-width: 150px;
}

#ws-clients-table .ws-delete {
    width: 70px;
    min-width: 70px;
    max-width: 70px;
    text-align: center;
    display: flex;
    justify-content: center;
    align-items: center;
    vertical-align: middle;
}

/* Löschen column - very narrow */
#ws-clients-table th:nth-child(12) {
    width: 70px;
    min-width: 70px;
    max-width: 70px;
    text-align: center;
}

/* Ensure table layout is auto for flexible column widths */
table {
    table-layout: auto;
}

th {
    background: #f7fafc;
    color: #222;
}

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

.multi-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
    width: 100%;
}

.multi-item {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 6px;
    background: #f1f3f7;
    border-radius: 6px;
    padding: 3px 8px;
    word-break: break-word;
    width: 100%;
    box-sizing: border-box;
    white-space: pre-line;
    position: relative;
}

/* Spezielle Formatierung für interne Kommentare */
.multi-item.internal-comment {
    background: #e0e2e6;
}

/* Spezielle Formatierung für Email-Adressen */
.multi-item.email-item {
    flex-direction: column;
    align-items: stretch;
}

.multi-item.email-item .multi-btn {
    align-self: flex-end;
    margin-top: 1px;
}

.multi-btn {
    background: none;
    border: none;
    color: #4CAF50;
    font-size: 18px;
    cursor: pointer;
    padding: 0 4px;
    transition: color 0.2s;
}

.multi-btn:hover {
    color: #e53935;
}

.add-btn {
    background: #4CAF50;
    color: #fff;
    border: none;
    border-radius: 50%;
    width: 26px;
    height: 26px;
    font-size: 20px;
    cursor: pointer;
    margin-left: 2px;
    transition: background 0.2s;
}

.add-btn:hover {
    background: #388e3c;
}

tr:nth-child(odd) {
    background: #fff;
}

tr:nth-child(even) {
    background: #f8fafc;
}

.hidden-col { 
    display: none !important; 
}

/* Highlighting für abweichende Werte */
.highlight-different {
    color: #4CAF50 !important;
}

/* Ensure green highlighting works for all weekday columns */
.col-mo.highlight-different,
.col-di.highlight-different,
.col-mi.highlight-different,
.col-do.highlight-different,
.col-fr.highlight-different,
.col-stunden.highlight-different {
    color: #4CAF50 !important;
}

/* Ultra-specific rules to override everything */
#clients-table tbody tr td.col-mo.highlight-different,
#clients-table tbody tr td.col-di.highlight-different,
#clients-table tbody tr td.col-mi.highlight-different,
#clients-table tbody tr td.col-do.highlight-different,
#clients-table tbody tr td.col-fr.highlight-different,
#clients-table tbody tr td.col-stunden.highlight-different {
    color: #4CAF50 !important;
}


#column-toggle-bar {
    margin-bottom: 18px;
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: center;
}

#column-toggle-bar label {
    font-size: 16px;
    gap: 4px;
    cursor: pointer;
}

#column-toggle-bar input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: #ccc;
}

/* Wochen-Standard column toggle bar styling */
#ws-column-toggle-bar {
    margin-bottom: 18px;
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: center;
}

#ws-column-toggle-bar label {
    font-size: 16px;
    gap: 4px;
    cursor: pointer;
}

#ws-column-toggle-bar input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: #ccc;
}

@media (max-width: 900px) {
    #column-toggle-bar label {
        font-size: 14px;
    }
    #column-toggle-bar input[type="checkbox"] {
        width: 15px;
        height: 15px;
    }
    #ws-column-toggle-bar label {
        font-size: 14px;
    }
    #ws-column-toggle-bar input[type="checkbox"] {
        width: 15px;
        height: 15px;
    }
}

@media (max-width: 600px) {
    #column-toggle-bar {
        gap: 8px;
        margin-bottom: 10px;
    }
    #column-toggle-bar label {
        font-size: 12px;
        min-width: 120px;
        margin-bottom: 2px;
    }
    #column-toggle-bar input[type="checkbox"] {
        width: 13px;
        height: 13px;
    }
    #ws-column-toggle-bar {
        gap: 8px;
        margin-bottom: 10px;
    }
    #ws-column-toggle-bar label {
        font-size: 12px;
        min-width: 120px;
        margin-bottom: 2px;
    }
    #ws-column-toggle-bar input[type="checkbox"] {
        width: 13px;
        height: 13px;
    }
    .container { 
        padding: 2px 0; 
    }
    h1 { 
        font-size: 22px; 
    }
}

.switch {
    position: relative;
    display: inline-block;
    width: 40px;
    height: 22px;
}

.switch input { 
    opacity: 0; 
    width: 0; 
    height: 0; 
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0; 
    left: 0; 
    right: 0; 
    bottom: 0;
    background-color: #ccc;
    transition: .3s;
    border-radius: 22px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 2px;
    bottom: 2px;
    background-color: white;
    transition: .3s;
    border-radius: 50%;
}

.switch input:checked + .slider {
    background-color: #4CAF50;
}

.switch input:checked + .slider:before {
    transform: translateX(18px);
}

#main-navbar {
    width: calc(100vw - 60px);
    background: #e0e0e0;
    margin: 0 30px 19px 30px;
    padding: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 64px;
    box-sizing: border-box;
    border-radius: 18px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    position: relative;
    border-top: 1px solid #e0e0e0;
}



#navbar-inner {
    position: relative;
    z-index: 2;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 64px;
    background: none;
    border-radius: 0;
    box-shadow: none;
    padding: 0;
    min-width: 0;
    min-height: 64px;
    margin-left: 40px;
}

.nav-link {
    font-size: 24px;
    cursor: pointer;
    font-family: 'Segoe UI', Arial, sans-serif;
    font-weight: 500;
    color: #444444;
    transition: color 0.18s;
    padding: 8px 18px;
    border-radius: 6px;
    user-select: none;
    text-decoration: none;
    outline: none;
    border: none;
    background: none;
    display: inline-block;
    text-shadow: 0 1px 2px rgba(128,128,128,0.6);
}

/* 2-spaltiges Layout für Navigation */
.nav-column {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

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

.nav-link.selected {
    color: #43a047;
    font-weight: 500;
    background: none;
    text-decoration: none;
}

.nav-link:hover {
    color: #43a047;
    background: none;
}

/* Modal styles */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0,0,0,0.4);
}

.modal-content {
    background-color: #fefefe;
    margin: 15% auto;
    padding: 20px;
    border: 1px solid #888;
    width: 80%;
    max-width: 500px;
    border-radius: 8px;
}

.close {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
}

.close:hover,
.close:focus {
    color: black;
    text-decoration: none;
    cursor: pointer;
}

/* Sub-Navigation für Mailing */
#mailing-sub-navbar,
#logging-sub-navbar {
    background: #fff;
    margin: 0 0 54px 0;
    padding: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 36px;
    box-sizing: border-box;
    border-radius: 8px;
    border: 1px solid #4A4A4A;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

/* Auswahlleiste für Klienten/Mitarbeiter */
#client-staff-selection-bar,
#kw-client-staff-selection-bar {
    background: #fff;
    margin: 0 0 30px 0;
    padding: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 36px;
    box-sizing: border-box;
    border-radius: 8px;
    border: 1px solid #4A4A4A;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

#mailing-sub-navbar-inner,
#logging-sub-navbar-inner,
#client-staff-selection-inner,
#kw-client-staff-selection-inner {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0;
    background: none;
    border-radius: 0;
    box-shadow: none;
    padding: 0;
    min-width: 0;
    min-height: 36px;
}

.sub-nav-link,
.selection-nav-link {
    font-size: 16px;
    cursor: pointer;
    font-family: 'Segoe UI', Arial, sans-serif;
    font-weight: 500;
    color: #4A4A4A;
    transition: all 0.18s;
    padding: 8px 16px;
    user-select: none;
    text-decoration: none;
    outline: none;
    border: none;
    background: #fff;
    display: inline-block;
    border-right: 1px solid #4A4A4A;
    flex: 1;
    text-align: center;
    position: relative;
    text-shadow: 0 1px 2px rgba(0,0,0,0.1);
}

.sub-nav-link:last-child,
.selection-nav-link:last-child {
    border-right: none;
}

.sub-nav-link.selected,
.selection-nav-link.selected {
    color: #4A4A4A;
    font-weight: 600;
    background: #f0f0f0;
    border-top: none;
    border-bottom: none;
}

.sub-nav-link:hover:not(.selected),
.selection-nav-link:hover:not(.selected) {
    background: #f8f8f8;
    color: #4A4A4A;
}

/* Password field with eye toggle */
.password-field-container {
    position: relative;
    display: flex;
    align-items: center;
}

.password-field-container input {
    padding-right: 34px !important;
    width: 100% !important;
}

.password-toggle {
    position: absolute;
    right: 6px;
    top: 50%;
    transform: translateY(-50%);
    cursor: pointer;
    width: 32px;
    height: 32px;
    opacity: 0.6 !important;
    transition: opacity 0.2s;
    user-select: none;
    z-index: 10;
}

.password-toggle:hover {
    opacity: 1 !important;
}

.password-toggle img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

/* Timeline styles - exact copy from wochenplaene.html */
.timeline-container {
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 0px 30px 15px 30px;
    max-width: 1200px;
    margin-left: auto;
    margin-right: auto;
    gap: 32px;
}

.timeline-week {
    flex: 1;
}

.timeline-week.left {
    margin-right: 0;
}

.timeline-week.right {
    margin-left: 0;
    margin-right: 0;
}

.timeline-header {
    flex: 0 0 auto;
    font-size: 32px;
    color: #333;
    font-family: 'Segoe UI', Arial, sans-serif;
    text-align: center;
    min-width: 200px;
    margin-bottom: 15px;
    margin-top: 25px;
}

.admin-header-content {
    position: relative;
    display: inline-block;
}

.admin-heart-image {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 92px;
    height: 92px;
    opacity: 0.08;
    z-index: 1;
    pointer-events: none;
    display: none; /* Hidden by default, shown via JavaScript for admin users */
}

.admin-header-content span {
    position: relative;
    z-index: 2;
}

/* Exact copy of working table styles from wochenplaene.html */
.timeline-table {
    border-collapse: collapse;
    margin: 0;
    display: inline-block;
    vertical-align: top;
    background: transparent;
}

.timeline-table th, 
.timeline-table td {
    border: 1px solid black;
    padding: 2px;
    text-align: center;
    min-width: 60px;
    font-size: 12px;
    font-family: 'Segoe UI', Arial, sans-serif;
}

.timeline-table th {
    padding: 1px;
}

.timeline-table .kw-header {
    background-color: #f0f0f0;
    color: slategray;
    width: 40px;
    min-width: 40px;
    max-width: 40px;
    border: 1px solid #444;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);
}

/* KW-Zellen von der allgemeinen min-width-Regel ausschließen */
.timeline-table .kw-header,
.timeline-table .kw-cell {
    min-width: 40px !important;
    max-width: 40px !important;
}

.timeline-table .time-cell {
    font-weight: normal;
    font-size: 12px;
    background-color: #f4f6fb;
}

.timeline-table .mo-cell, 
.timeline-table .di-cell, 
.timeline-table .do-cell, 
.timeline-table .fr-cell, 
.timeline-table .kw-cell, 
.timeline-table .mi-cell {
    position: relative;
}

.timeline-table .red-line {
    position: absolute;
    top: 0;
    bottom: -4px;
    width: 3px;
    background-color: rgba(128, 128, 128, 0.6); /* Make bars semi-transparent */
    z-index: 5; /* Put red lines behind day names */
}

.timeline-table .mo-line {
    /* Position wird dynamisch gesetzt */
}

.timeline-table .di-line {
    /* Position wird dynamisch gesetzt */
}

.timeline-table .do-line {
    /* Position wird dynamisch gesetzt */
}

.timeline-table .letter {
    position: absolute;
    bottom: -20px;
    font-size: 12px;
    white-space: nowrap;
    color: gray;
    /* Position wird dynamisch gesetzt */
}

.timeline-table .letter-b {
    /* Position wird dynamisch gesetzt */
}

.timeline-table .letter-c {
    /* Position wird dynamisch gesetzt */
}

.timeline-table .letter-d {
    /* Position wird dynamisch gesetzt */
}

.timeline-table .time-header {
    position: absolute;
    top: -25px;
    left: 50%;
    transform: translateX(-50%);
    color: gray;
    background-color: transparent;
    font-size: 14px;
    font-weight: normal;
    text-align: center;
    white-space: nowrap;
    z-index: 10;
}

.timeline-table .mo-cell, 
.timeline-table .di-cell, 
.timeline-table .mi-cell, 
.timeline-table .do-cell, 
.timeline-table .fr-cell {
    background-color: white;
    width: 80px;
    min-width: 80px;
    max-width: 80px;
    border: 1px solid #444;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);
    z-index: 20; /* Move day names to front level */
    position: relative;
}

.timeline-table .kw-header {
    background-color: #f0f0f0;
    color: slategray;
    width: 40px;
    min-width: 40px;
    max-width: 40px;
    border: 1px solid #444;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);
}

.timeline-table .green-triangle {
    position: absolute;
    width: 0;
    height: 0;
    border-left: 12px solid transparent;
    border-right: 12px solid transparent;
    border-top: 18px solid rgba(0, 128, 0, 0.4);
    left: 50%;
    top: -21px;
    z-index: 1;
    transform: translateX(-50%);
}

/* ============================================================================
   ERROR PAGE STYLING
   ============================================================================ */

.error-container {
    text-align: center;
    margin-top: 70px;
    padding: 20px;
}

.error-image {
    margin-bottom: 30px;
}

.error-image img {
    width: auto;
    height: auto;
}

.error-title {
    font-size: 24px;
    font-weight: bold;
    margin-bottom: 20px;
    color: #333;
}

.error-text {
    font-size: 16px;
    color: #666;
    line-height: 1.5;
}

.error-back-link {
    margin-top: 30px;
}

.back-button {
    display: inline-block;
    padding: 12px 24px;
    background-color: #01ff00;
    color: black;
    text-decoration: none;
    border-radius: 6px;
    font-size: 16px;
    font-weight: bold;
    transition: background-color 0.2s ease;
    box-shadow: 0 2px 4px rgba(1, 255, 0, 0.2);
}

.back-button:hover {
    background-color: #00cc00;
    text-decoration: none;
    color: black;
}

.back-button:active {
    background-color: #009900;
    transform: translateY(1px);
} 