* { box-sizing: border-box; }

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    margin: 0; padding: 0;
    background: #f0f0f5; color: #333; line-height: 1.6;
}

/* ===== HEADER (3-Zonen-Layout) ===== */
header {
    display: flex; align-items: center; gap: 0.5rem;
    padding: 0.75rem 1rem;
    background: white;
    box-shadow: 0 1px 4px rgba(0,0,0,0.08);
    position: sticky; top: 0; z-index: 100;
}

.header-left { display: flex; align-items: center; gap: 0.6rem; flex-shrink: 0; }

.header-center { flex: 1; text-align: center; }

.header-center h1 {
    margin: 0; font-size: 1.3rem; color: #6d4aff;  /* PROTON-PURPLE */
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

.header-right { flex-shrink: 0; }

.nav-toggle {
    display: flex; flex-direction: column; gap: 4px;
    cursor: pointer; padding: 0.4rem;
    background: none; border: none;
}

.nav-toggle span {
    display: block; width: 24px; height: 2.5px;
    background: #6d4aff; border-radius: 2px;
}

/* ===== LOGIN CONTAINER ===== */
.login-container h1 { text-align: center; margin-bottom: 1.5rem; color: #6d4aff; }  /* PROTON-PURPLE */

/* ===== NAV MENU ===== */
.nav-menu {
    display: none;
    flex-direction: column;
    position: absolute; top: 100%; left: 0;
    background: white; min-width: 180px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    padding: 0.5rem; border-top: 1px solid #eee;
    z-index: 101;
}

.nav-menu.open { display: flex; }

.nav-item {
    text-decoration: none; color: #555;
    padding: 0.65rem 0.8rem; border-radius: 4px;
    transition: background 0.15s; font-size: 0.95rem;
}

.nav-item:hover { background: #f0f0f5; }

.nav-item.active { background: #6d4aff; color: white; }

.nav-item.logout {
    color: #dc3545; margin-top: 0.5rem;
    border-top: 1px solid #eee; border-radius: 4px;
    font-weight: 600;
}

.btn-back {
    text-decoration: none; color: #6d4aff;
    font-size: 0.9rem; white-space: nowrap;
    padding: 0.4rem 0.8rem; border-radius: 6px;
    border: 1px solid #6d4aff; transition: background 0.15s;
}

.btn-back:hover { background: #6d4aff; color: white; }

/* ===== MAIN ===== */
main { max-width: 1100px; margin: 1.5rem auto; padding: 0 1rem 3rem; }

/* ===== BUTTONS ===== */
.btn {
    background: #6d4aff; color: white;
    padding: 0.6rem 1.2rem; border-radius: 6px;
    text-decoration: none; border: none; cursor: pointer;
    font-size: 0.95rem; transition: background 0.2s;
}

.btn:hover { background: #5938d9; }

.btn-small {
    background: #6d4aff; color: white;
    padding: 0.35rem 0.7rem; border-radius: 4px;
    text-decoration: none; font-size: 0.85rem; display: inline-block;
}

.btn-small:hover { background: #5938d9; }

.btn-danger { background: #dc3545 !important; }
.btn-danger:hover { background: #c82333 !important; }

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

.btn-success { background: #28a745 !important; }
.btn-success:hover { background: #218838 !important; }

/* ===== TABELLEN ===== */
table {
    width: 100%; border-collapse: collapse;
    background: white; border-radius: 8px; overflow: hidden;
    box-shadow: 0 1px 4px rgba(0,0,0,0.08);
}

th, td { padding: 0.85rem 1rem; text-align: left; border-bottom: 1px solid #eee; }

th {
    background: #fafafa; font-weight: 600; color: #555;
    font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.5px;
}

tbody tr:last-child td { border-bottom: none; }
tbody tr:hover { background: #f8f7ff; }

/* ===== FORMULARE ===== */
form label { display: block; margin-bottom: 0.5rem; font-weight: 600; color: #444; }

form input, form textarea, form select {
    width: 100%; padding: 0.75rem;
    border: 1px solid #ccc; border-radius: 6px;
    font-size: 1rem; font-family: inherit;
    transition: border-color 0.2s;
}

form input:focus, form textarea:focus, form select:focus {
    border-color: #6d4aff; outline: none;
    box-shadow: 0 0 0 3px rgba(109, 74, 255, 0.15);
}

input[name="csrf_token"] { display: none; }

.form-section {
    background: white; border-radius: 10px;
    padding: 1.5rem; box-shadow: 0 1px 4px rgba(0,0,0,0.08);
    margin-bottom: 1.5rem;
}

/* ===== SUCHE-LEISTE ===== */
.search-bar {
    background: white; border-radius: 8px;
    padding: 1rem 1.25rem; margin-bottom: 1.5rem;
    box-shadow: 0 1px 4px rgba(0,0,0,0.08);
    display: flex; align-items: flex-end;
    gap: 1rem; flex-wrap: wrap;
}

.search-bar label {
    font-size: 0.85rem; font-weight: 600;
    color: #555; margin-bottom: 0.4rem;
    display: block;
}

.search-bar input[type="text"],
.search-bar input[type="date"] {
    width: 100%; padding: 0.65rem 0.75rem;
    font-size: 1rem; border: 1px solid #ccc;
    border-radius: 6px; font-family: inherit;
    background: white; color: #333;
    box-sizing: border-box; height: 42px;
}

.search-bar input[type="text"]:focus,
.search-bar input[type="date"]:focus {
    border-color: #6d4aff; outline: none;
    box-shadow: 0 0 0 3px rgba(109, 74, 255, 0.15);
}

.search-bar .search-field { flex: 1; min-width: 250px; max-width: 600px; }

.search-bar .search-action { flex-shrink: 0; }

/* ===== EINTRAGS-KARTEN ===== */
.entries-list { display: flex; flex-direction: column; gap: 1rem; }

.entry-card {
    background: white; border-radius: 10px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.08);
    overflow: hidden; transition: box-shadow 0.2s;
}

.entry-card:hover { box-shadow: 0 2px 12px rgba(0,0,0,0.12); }

.entry-card-header {
    display: flex; justify-content: space-between;
    align-items: flex-start; padding: 1rem 1.25rem 0.5rem;
    gap: 1rem; flex-wrap: wrap;
}

.entry-date { font-size: 0.85rem; color: #888; font-weight: 600; white-space: nowrap; }

.entry-company { color: #6d4aff; font-weight: 600; font-size: 0.9rem; }

.entry-status {
    display: inline-block; padding: 0.25rem 0.75rem;
    border-radius: 20px; font-size: 0.8rem; font-weight: 600; white-space: nowrap;
}

.status-open { background: #fff3cd; color: #856404; }
.status-done { background: #d4edda; color: #155724; }
.status-waiting { background: #cce5ff; color: #004085; }
.status-default { background: #e9ecef; color: #495057; }

.entry-actions { display: flex; gap: 0.5rem; flex-shrink: 0; }

.entry-body { padding: 0.5rem 1.25rem 1.25rem; }

.entry-note {
    font-size: 1.05rem; line-height: 1.6;
    color: #333; white-space: pre-wrap;
    word-break: break-word; margin: 0;
}

.entry-footer {
    padding: 0.5rem 1.25rem 0.75rem;
    border-top: 1px solid #f0f0f0;
    font-size: 0.8rem; color: #aaa;
}

/* ===== EMPTY STATE ===== */
.empty-state { text-align: center; padding: 3rem 1rem; color: #999; }
.empty-state p { font-size: 1.1rem; margin-bottom: 1.5rem; }

/* ===== WARNUNG / SUCCESS / ERROR ===== */
.warning {
    background: #fff3cd; color: #856404;
    padding: 1rem; border-radius: 6px; margin-bottom: 1rem;
    border-left: 4px solid #ffc107;
}

.success { background: #d4edda; color: #155724; padding: 0.75rem; border-radius: 6px; margin-bottom: 1rem; }
.error { background: #f8d7da; color: #721c24; padding: 0.75rem; border-radius: 6px; margin-bottom: 1rem; }

/* ===== LOGIN ===== */
.login-wrapper {
    min-height: 100vh; display: flex; align-items: center; justify-content: center;
    padding: 1rem; background: #f0f0f5;
}

.login-container {
    width: 100%; max-width: 400px;
    padding: 2rem; background: white;
    border-radius: 10px; box-shadow: 0 2px 12px rgba(0,0,0,0.1);
}

.login-container h1 { text-align: center; margin-bottom: 1.5rem; color: #6d4aff; }

.error-msg { background: #f8d7da; color: #721c24; padding: 0.75rem; border-radius: 6px; margin-bottom: 1rem; border-left: 4px solid #dc3545; }
.success-msg { background: #d4edda; color: #155724; padding: 0.75rem; border-radius: 6px; margin-bottom: 1rem; border-left: 4px solid #28a745; }

/* ===== MOBILE ===== */
@media (max-width: 600px) {
    header { padding: 0.6rem 0.75rem; }
    .header-center h1 { font-size: 1.1rem; }
    main { padding: 0 0.5rem 2rem; }

    table, thead, tbody, th, td, tr { display: block; }
    thead { display: none; }
    table { background: transparent; box-shadow: none; }
    table tr { background: white; border-radius: 8px; box-shadow: 0 1px 4px rgba(0,0,0,0.08); margin-bottom: 0.75rem; padding: 0.75rem; }
    td { border: none; padding: 0.25rem 0; }

    .search-bar {
        flex-direction: column; align-items: stretch;
    }

    .search-bar .search-field {
        min-width: 0; max-width: 100%;
    }

    .search-bar .search-action {
        width: 100%;
    }

    .search-bar .search-action .btn {
        width: 100%; text-align: center;
    }

    .entry-card-header { flex-direction: column; align-items: flex-start; }
    .entry-actions { width: 100%; justify-content: flex-end; }
}