/* =====================================================
   BERICHTSHEFT SERVER - STYLESHEET
   ===================================================== */

:root {
    --primary-color: #2c3e50;
    --secondary-color: #3498db;
    --success-color: #27ae60;
    --warning-color: #f39c12;
    --danger-color: #e74c3c;
    --info-color: #17a2b8;
    --light-color: #f8f9fa;
    --dark-color: #343a40;
    --border-color: #dee2e6;
    --text-color: #333;
    --text-muted: #6c757d;
    --font-size-base: 16px;
    --font-size-large: 18px;
    --border-radius: 6px;
    --box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    font-size: var(--font-size-base);
    line-height: 1.6;
    color: var(--text-color);
    background-color: #f4f6f9;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* ----- LAYOUT ----- */
.wrapper {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.container {
    width: 100%;
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
}

main.container {
    flex: 1;
    padding: 30px 20px;
}

/* ----- NAVBAR ----- */
.navbar {
    background: var(--primary-color);
    color: white;
    padding: 0 20px;
    box-shadow: var(--box-shadow);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
    min-height: 60px;
}

.navbar-brand a {
    color: white;
    text-decoration: none;
    font-size: 20px;
    font-weight: 600;
}

.navbar-brand a:hover {
    color: rgba(255,255,255,0.9);
}

.navbar-menu {
    display: flex;
    gap: 5px;
    flex-wrap: wrap;
    align-items: center;
}

.navbar-menu a {
    color: white;
    text-decoration: none;
    padding: 10px 15px;
    border-radius: var(--border-radius);
    transition: background-color 0.2s;
    font-size: 15px;
}

.navbar-menu a:hover {
    background: rgba(255,255,255,0.15);
}

.navbar-user {
    display: flex;
    align-items: center;
    gap: 15px;
}

.navbar-user .user-info {
    display: flex;
    align-items: center;
    gap: 10px;
    color: rgba(255,255,255,0.9);
    font-size: 14px;
}

.navbar-user .rolle-badge {
    background: var(--secondary-color);
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    text-transform: uppercase;
    font-weight: 500;
}

.navbar-user .btn {
    padding: 8px 16px;
    font-size: 14px;
}

/* ----- HEADER (Alternative) ----- */
.header {
    background: var(--primary-color);
    color: white;
    padding: 15px 0;
    box-shadow: var(--box-shadow);
}

.header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
}

.header h1 {
    font-size: 24px;
    font-weight: 600;
}

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

.header-nav a {
    color: white;
    text-decoration: none;
    padding: 8px 16px;
    border-radius: var(--border-radius);
    transition: background-color 0.2s;
}

.header-nav a:hover {
    background: rgba(255,255,255,0.1);
}

.user-info {
    display: flex;
    align-items: center;
    gap: 15px;
    color: rgba(255,255,255,0.9);
    font-size: 14px;
}

.user-info .rolle {
    background: var(--secondary-color);
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 12px;
    text-transform: uppercase;
}

/* ----- NAVIGATION ----- */
.nav-main {
    background: white;
    border-bottom: 1px solid var(--border-color);
    padding: 0;
}

.nav-main ul {
    list-style: none;
    display: flex;
    gap: 5px;
    padding: 10px 0;
}

.nav-main a {
    display: block;
    padding: 12px 20px;
    color: var(--text-color);
    text-decoration: none;
    border-radius: var(--border-radius);
    font-size: var(--font-size-base);
    transition: all 0.2s;
}

.nav-main a:hover,
.nav-main a.active {
    background: var(--secondary-color);
    color: white;
}

/* ----- FOOTER ----- */
.footer {
    background: var(--dark-color);
    color: rgba(255,255,255,0.7);
    padding: 20px 0;
    margin-top: auto;
}

.footer .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
}

.footer-links {
    display: flex;
    gap: 20px;
}

.footer-links a {
    color: rgba(255,255,255,0.7);
    text-decoration: none;
    transition: color 0.2s;
}

.footer-links a:hover {
    color: white;
}

/* ----- CARDS & BOXES ----- */
.card {
    background: white;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    margin-bottom: 20px;
    overflow: hidden;
}

.card-header {
    background: var(--light-color);
    padding: 15px 20px;
    border-bottom: 1px solid var(--border-color);
    font-size: var(--font-size-large);
    font-weight: 600;
}

.card-body {
    padding: 20px;
}

.card-footer {
    background: var(--light-color);
    padding: 15px 20px;
    border-top: 1px solid var(--border-color);
}

/* ----- FORMULARE ----- */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    font-size: var(--font-size-base);
    color: var(--text-color);
}

.form-control {
    width: 100%;
    padding: 12px 15px;
    font-size: var(--font-size-base);
    border: 2px solid var(--border-color);
    border-radius: var(--border-radius);
    transition: border-color 0.2s, box-shadow 0.2s;
}

.form-control:focus {
    outline: none;
    border-color: var(--secondary-color);
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.2);
}

.form-control-large {
    padding: 15px 18px;
    font-size: var(--font-size-large);
}

textarea.form-control {
    min-height: 120px;
    resize: vertical;
}

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
}

.form-inline {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}

.form-text {
    font-size: 14px;
    color: var(--text-muted);
    margin-top: 5px;
}

/* ----- BUTTONS ----- */
.btn {
    display: inline-block;
    padding: 12px 24px;
    font-size: var(--font-size-base);
    font-weight: 500;
    text-align: center;
    text-decoration: none;
    border: none;
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: all 0.2s;
}

.btn-large {
    padding: 15px 30px;
    font-size: var(--font-size-large);
}

.btn-small {
    padding: 8px 16px;
    font-size: 14px;
}

.btn-primary {
    background: var(--secondary-color);
    color: white;
}

.btn-primary:hover {
    background: #2980b9;
}

.btn-success {
    background: var(--success-color);
    color: white;
}

.btn-success:hover {
    background: #219a52;
}

.btn-warning {
    background: var(--warning-color);
    color: white;
}

.btn-warning:hover {
    background: #e08e0b;
}

.btn-danger {
    background: var(--danger-color);
    color: white;
}

.btn-danger:hover {
    background: #c0392b;
}

.btn-secondary {
    background: var(--text-muted);
    color: white;
}

.btn-secondary:hover {
    background: #5a6268;
}

.btn-group {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

/* ----- TABELLEN ----- */
.table-responsive {
    overflow-x: auto;
}

.table {
    width: 100%;
    border-collapse: collapse;
    font-size: var(--font-size-base);
}

.table th,
.table td {
    padding: 15px;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

.table th {
    background: var(--light-color);
    font-weight: 600;
    white-space: nowrap;
}

.table tbody tr:hover {
    background: rgba(52, 152, 219, 0.05);
}

.table-striped tbody tr:nth-child(even) {
    background: var(--light-color);
}

.table-highlight {
    background-color: rgba(52, 152, 219, 0.1) !important;
}

/* ----- ALERTS & MESSAGES ----- */
.alert {
    padding: 15px 20px;
    border-radius: var(--border-radius);
    margin-bottom: 20px;
    font-size: var(--font-size-base);
}

.alert-success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.alert-warning {
    background: #fff3cd;
    color: #856404;
    border: 1px solid #ffeeba;
}

.alert-danger {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.alert-info {
    background: #d1ecf1;
    color: #0c5460;
    border: 1px solid #bee5eb;
}

/* ----- STATUS BADGES ----- */
.status-badge {
    display: inline-block;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 500;
}

.status-entwurf {
    background: #ffeeba;
    color: #856404;
}

.status-eingereicht {
    background: #b8daff;
    color: #004085;
}

.status-nacharbeit {
    background: #f5c6cb;
    color: #721c24;
}

.status-freigegeben {
    background: #c3e6cb;
    color: #155724;
}

/* ----- LOGIN-SEITE ----- */
.login-wrapper {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    padding: 20px;
}

.login-box {
    background: white;
    padding: 40px;
    border-radius: 10px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    width: 100%;
    max-width: 450px;
}

.login-box h1 {
    text-align: center;
    margin-bottom: 10px;
    color: var(--primary-color);
}

.login-box .subtitle {
    text-align: center;
    color: var(--text-muted);
    margin-bottom: 30px;
}

.login-box .btn {
    width: 100%;
    margin-top: 10px;
}

/* ----- HINWEIS-MODAL ----- */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 20px;
}

.modal-content {
    background: white;
    border-radius: 10px;
    max-width: 700px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
}

.modal-header {
    background: var(--danger-color);
    color: white;
    padding: 20px;
    font-size: 20px;
    font-weight: 600;
}

.modal-body {
    padding: 30px;
}

.modal-body h3 {
    color: var(--danger-color);
    margin-bottom: 15px;
}

.modal-body ul {
    margin: 15px 0 15px 20px;
}

.modal-body li {
    margin-bottom: 10px;
}

.modal-footer {
    padding: 20px;
    border-top: 1px solid var(--border-color);
    display: flex;
    gap: 10px;
    justify-content: flex-end;
}

/* ----- BERICHTSHEFT FORMULAR ----- */
.berichtsheft-header {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
    padding: 20px;
    background: var(--light-color);
    border-radius: var(--border-radius);
}

.berichtsheft-header-item {
    display: flex;
    flex-direction: column;
}

.berichtsheft-header-item .label {
    font-size: 14px;
    color: var(--text-muted);
    margin-bottom: 5px;
}

.berichtsheft-header-item .value {
    font-size: var(--font-size-large);
    font-weight: 600;
}

.tageseintrag {
    background: white;
    border: 2px solid var(--border-color);
    border-radius: var(--border-radius);
    margin-bottom: 15px;
    overflow: hidden;
}

.tageseintrag-header {
    background: var(--primary-color);
    color: white;
    padding: 12px 20px;
    font-weight: 600;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.tageseintrag-body {
    padding: 20px;
    display: grid;
    grid-template-columns: 1fr 250px 150px;
    gap: 20px;
}

.tageseintrag-body .taetigkeit-field {
    grid-column: 1;
}

.tageseintrag-body .bemerkung-field {
    grid-column: 2;
}

.tageseintrag-body .zeit-field {
    grid-column: 3;
}

.zeit-inputs {
    display: flex;
    gap: 10px;
    align-items: center;
}

.zeit-inputs input {
    width: 70px;
    text-align: center;
}

.zeit-inputs span {
    color: var(--text-muted);
}

.gesamt-zeit {
    background: var(--success-color);
    color: white;
    padding: 20px;
    border-radius: var(--border-radius);
    text-align: center;
    font-size: var(--font-size-large);
    margin-top: 20px;
}

/* ----- UNTERSCHRIFTEN ----- */
.unterschriften-bereich {
    margin-top: 30px;
    padding: 20px;
    background: var(--light-color);
    border-radius: var(--border-radius);
}

.unterschriften-bereich h3 {
    margin-bottom: 15px;
    color: var(--primary-color);
}

.unterschrift-box {
    display: inline-block;
    padding: 15px 25px;
    border: 2px dashed var(--border-color);
    border-radius: var(--border-radius);
    margin: 10px;
    min-width: 250px;
    text-align: center;
    vertical-align: top;
}

.unterschrift-box.unterschrieben {
    border-color: var(--success-color);
    border-style: solid;
    background: #d4edda;
}

.unterschrift-box .rolle {
    font-weight: 600;
    margin-bottom: 10px;
}

.unterschrift-box .details {
    font-size: 14px;
    color: var(--text-muted);
}

.unterschrift-box.unterschrieben .details {
    color: var(--success-color);
}

/* ----- ÜBERSICHT / DASHBOARD ----- */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: white;
    padding: 25px;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    text-align: center;
}

.stat-card .number {
    font-size: 36px;
    font-weight: 700;
    color: var(--secondary-color);
}

.stat-card .label {
    color: var(--text-muted);
    margin-top: 5px;
}

/* ----- KALENDER / JAHRESÜBERSICHT ----- */
.kalender-grid {
    display: grid;
    grid-template-columns: repeat(13, 1fr);
    gap: 8px;
}

.kalender-woche {
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    font-weight: bold;
    font-size: 14px;
    transition: transform 0.2s, box-shadow 0.2s;
}

.kalender-woche a {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    color: white;
    text-decoration: none;
    border-radius: 8px;
}

.kalender-woche.aktuell {
    box-shadow: 0 0 0 3px #2c3e50;
}

.kalender-woche.ausserhalb {
    background: #ecf0f1;
    color: #bdc3c7;
}

.kalender-woche.status-offen {
    background: #95a5a6;
    color: white;
}

.kalender-woche.status-offen a {
    color: white;
}

.kalender-woche.status-entwurf {
    background: #f39c12;
    color: white;
}

.kalender-woche.status-eingereicht {
    background: #3498db;
    color: white;
}

.kalender-woche.status-nacharbeit {
    background: #e74c3c;
    color: white;
}

.kalender-woche.status-freigegeben {
    background: #27ae60;
    color: white;
}

.kalender-woche.status-keine {
    background: #ecf0f1;
    color: #bdc3c7;
}

.kalender-woche:not(.ausserhalb):not(.status-keine):hover {
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
    z-index: 10;
}

.kalender-legende {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    padding-top: 15px;
    border-top: 1px solid #eee;
}

.legende-item {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 13px;
}

.legende-farbe {
    width: 20px;
    height: 20px;
    border-radius: 4px;
}

/* ----- RESPONSIVE ----- */
@media (max-width: 992px) {
    .navbar {
        padding: 10px 15px;
    }
    
    .navbar-menu {
        order: 3;
        width: 100%;
        justify-content: center;
        padding-top: 10px;
        border-top: 1px solid rgba(255,255,255,0.1);
    }
    
    .kalender-grid {
        grid-template-columns: repeat(9, 1fr);
    }
}

@media (max-width: 768px) {
    .navbar {
        flex-direction: column;
        text-align: center;
    }
    
    .navbar-user {
        flex-direction: column;
        gap: 10px;
    }
    
    .header .container {
        flex-direction: column;
        text-align: center;
    }
    
    .nav-main ul {
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .tageseintrag-body {
        grid-template-columns: 1fr;
    }
    
    .tageseintrag-body .taetigkeit-field,
    .tageseintrag-body .bemerkung-field,
    .tageseintrag-body .zeit-field {
        grid-column: 1;
    }
    
    .footer .container {
        flex-direction: column;
        text-align: center;
    }
    
    .berichtsheft-header {
        grid-template-columns: 1fr;
    }
    
    .kalender-grid {
        grid-template-columns: repeat(6, 1fr);
    }
    
    .unterschrift-box {
        display: block;
        margin: 10px 0;
    }
}

@media (max-width: 480px) {
    .navbar-menu a {
        padding: 8px 10px;
        font-size: 13px;
    }
    
    .kalender-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

/* ----- UTILITIES ----- */
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-muted { color: var(--text-muted); }
.text-success { color: var(--success-color); }
.text-danger { color: var(--danger-color); }
.text-warning { color: var(--warning-color); }

.mt-1 { margin-top: 10px; }
.mt-2 { margin-top: 20px; }
.mt-3 { margin-top: 30px; }
.mb-1 { margin-bottom: 10px; }
.mb-2 { margin-bottom: 20px; }
.mb-3 { margin-bottom: 30px; }

.hidden { display: none; }