/* Reset & Base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    background: #f5f7fb;
    color: #1e293b;
    line-height: 1.5;
}

/* Container */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1rem;
}

/* Header */
.header {
    background: #ffffff;
    border-bottom: 1px solid #e2e8f0;
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 1.5rem;
    max-width: 1400px;
    margin: 0 auto;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.logo img {
    height: 36px;
    width: auto;
    border-radius: 8px;
}

.logo span {
    font-weight: 700;
    font-size: 1.35rem;
    background: linear-gradient(135deg, #0f3b5c 0%, #2c7da0 100%);
    background-clip: text;
    -webkit-background-clip: text;
    color: transparent;
    letter-spacing: -0.3px;
}

/* Navigation - Desktop */
.nav-links {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.nav-links a {
    color: #334155;
    text-decoration: none;
    padding: 0.5rem 0.9rem;
    border-radius: 40px;
    font-weight: 500;
    font-size: 0.9rem;
    transition: all 0.2s ease;
}

.nav-links a:hover {
    background: #f1f5f9;
    color: #0f3b5c;
}

/* Language switcher */
.lang-switcher {
    display: inline-flex;
    gap: 0.25rem;
    background: #f1f5f9;
    padding: 0.2rem 0.4rem;
    border-radius: 40px;
    margin-left: 0.5rem;
}

.lang-switcher a {
    padding: 0.3rem 0.6rem;
    font-size: 0.8rem;
    border-radius: 40px;
    background: transparent;
}

.lang-switcher a:hover {
    background: #e2e8f0;
}

/* Logout button */
a#logoutBtn {
    background: #fee2e2;
    color: #dc2626;
    margin-left: 0.25rem;
}

a#logoutBtn:hover {
    background: #fecaca;
    color: #b91c1c;
}

/* Hamburger – hidden on desktop */
.menu-toggle {
    display: none;
    background: #f1f5f9;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: #0f3b5c;
    padding: 0.4rem 0.8rem;
    border-radius: 40px;
    line-height: 1;
}

.menu-toggle:hover {
    background: #e2e8f0;
}

/* Cards */
.card {
    background: white;
    border-radius: 24px;
    padding: 1.5rem;
    margin-bottom: 1.25rem;
    box-shadow: 0 1px 3px rgba(0,0,0,0.04), 0 1px 2px rgba(0,0,0,0.02);
    transition: box-shadow 0.2s;
    border: 1px solid #eef2f6;
}

.card:hover {
    box-shadow: 0 8px 20px -6px rgba(0,0,0,0.08);
}

/* Buttons */
button, .btn, .clock-in-btn, .btn-danger {
    background: #2c7da0;
    border: none;
    color: white;
    padding: 0.75rem 1.5rem;
    font-size: 0.95rem;
    font-weight: 600;
    border-radius: 60px;
    cursor: pointer;
    transition: all 0.2s;
    width: 100%;
    max-width: 320px;
    display: inline-block;
    text-align: center;
}

button:active, .btn:active {
    transform: scale(0.97);
    background: #1f5068;
}

.btn-danger {
    background: #dc2626;
}
.btn-danger:active {
    background: #b91c1c;
}

/* Primary button (New User, etc.) */
.btn-primary {
    background: #2c7da0;
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    font-size: 0.95rem;
    font-weight: 600;
    border-radius: 60px;
    cursor: pointer;
    transition: all 0.2s;
    margin-bottom: 1rem;
    width: auto;
    display: inline-block;
}

.btn-primary:hover {
    background: #1f5068;
    transform: translateY(-1px);
}

/* Action buttons (Edit/Delete) */
.action-buttons {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.btn-edit, .btn-delete {
    background: none;
    border: 1px solid #cbd5e1;
    padding: 0.4rem 0.8rem;
    font-size: 0.8rem;
    font-weight: 500;
    border-radius: 40px;
    cursor: pointer;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    max-width: none;
    width: auto;
}

.btn-edit {
    background: #f8fafc;
    color: #2c7da0;
    border-color: #cbd5e1;
}

.btn-edit:hover {
    background: #eef2ff;
    border-color: #2c7da0;
}

.btn-delete {
    background: #fef2f2;
    color: #dc2626;
    border-color: #fecaca;
}

.btn-delete:hover {
    background: #fee2e2;
    border-color: #dc2626;
}

/* Form buttons (Save/Cancel) */
.form-buttons {
    display: flex;
    gap: 1rem;
    margin-top: 1rem;
}

.btn-save, .btn-cancel {
    background: #2c7da0;
    color: white;
    border: none;
    padding: 0.7rem 1.2rem;
    border-radius: 40px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.2s;
    width: auto;
}

.btn-save:hover {
    background: #1f5068;
}

.btn-cancel {
    background: #94a3b8;
}

.btn-cancel:hover {
    background: #64748b;
}

/* Forms */
input, select, textarea {
    width: 100%;
    padding: 0.8rem 1rem;
    margin: 0.5rem 0;
    border: 1px solid #cbd5e1;
    border-radius: 20px;
    font-size: 0.95rem;
    background: white;
    transition: all 0.2s;
}

input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: #2c7da0;
    box-shadow: 0 0 0 3px rgba(44,125,160,0.15);
}

/* Data tables */
.data-table, table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    border-radius: 24px;
    overflow: hidden;
    box-shadow: 0 1px 2px rgba(0,0,0,0.03);
}

.data-table th, .data-table td, th, td {
    padding: 0.9rem 1rem;
    text-align: left;
    border-bottom: 1px solid #eef2f6;
}

.data-table th, th {
    background: #f8fafc;
    font-weight: 600;
    color: #1e293b;
}

/* Map */
#map {
    height: 500px;
    border-radius: 24px;
    overflow: hidden;
    margin-top: 1rem;
    border: 1px solid #eef2f6;
}

/* Welcome card */
.welcome-card {
    background: linear-gradient(135deg, #e8f4f8 0%, #d9eaf1 100%);
    border-left: 5px solid #2c7da0;
    border-radius: 24px;
    text-align: center;
    padding: 1.25rem;
    margin-bottom: 1.5rem;
}

.welcome-card p {
    margin: 0.25rem 0;
}

.welcome-card strong {
    font-size: 1.2rem;
    color: #0f3b5c;
}

/* ==================== WORKER DASHBOARD MOBILE OPTIMIZATIONS ==================== */
.clock-in-btn, #clockOutBtn {
    width: 100%;
    padding: 1rem;
    font-size: 1.2rem;
    font-weight: 700;
    border-radius: 60px;
    margin: 0.75rem 0;
}

#current-entry.card {
    background: #e8f4f8;
    border-left: 6px solid #2c7da0;
    padding: 1.25rem;
    font-size: 1.1rem;
    text-align: center;
}

#current-entry.card p {
    margin: 0;
}

#baustellen-list h3 {
    font-size: 1.2rem;
    margin: 1rem 0 0.5rem;
    color: #0f3b5c;
}

#baustellen-list .clock-in-btn {
    background: white;
    color: #0f3b5c;
    border: 1px solid #cbd5e1;
    text-align: left;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    margin: 0.5rem 0;
    font-weight: 500;
    transition: all 0.2s;
}

#baustellen-list .clock-in-btn:active {
    background: #eef2ff;
    transform: scale(0.98);
}

#baustellen-list .clock-in-btn::after {
    content: "→";
    font-size: 1.2rem;
    opacity: 0.6;
}

/* ==================== LOGIN PAGE STYLES ==================== */
.login-page {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background: linear-gradient(135deg, #e8f4f8 0%, #d9eaf1 100%);
    margin: 0;
    padding: 1rem;
}

.login-container {
    max-width: 420px;
    width: 100%;
}

.login-card {
    background: white;
    border-radius: 32px;
    padding: 2rem 1.5rem;
    box-shadow: 0 20px 35px -10px rgba(0,0,0,0.1);
    transition: transform 0.2s;
}

.login-header {
    text-align: center;
    margin-bottom: 1.5rem;
}

.login-header h1 {
    font-size: 1.8rem;
    font-weight: 700;
    background: linear-gradient(135deg, #0f3b5c 0%, #2c7da0 100%);
    background-clip: text;
    -webkit-background-clip: text;
    color: transparent;
    margin: 0.5rem 0 0.25rem;
}

.login-header p {
    color: #64748b;
    font-size: 0.9rem;
    margin: 0;
}

.login-logo {
    height: 60px;
    width: auto;
    margin-bottom: 0.5rem;
}

.input-group {
    margin-bottom: 1.25rem;
}

.input-group label {
    display: block;
    font-weight: 500;
    margin-bottom: 0.4rem;
    color: #334155;
    font-size: 0.9rem;
}

.input-group input {
    width: 100%;
    padding: 0.85rem 1rem;
    border: 1px solid #cbd5e1;
    border-radius: 20px;
    font-size: 1rem;
    transition: all 0.2s;
    background: #f8fafc;
}

.input-group input:focus {
    outline: none;
    border-color: #2c7da0;
    background: white;
    box-shadow: 0 0 0 3px rgba(44,125,160,0.1);
}

.login-btn {
    background: #2c7da0;
    color: white;
    width: 100%;
    padding: 0.85rem;
    font-size: 1rem;
    font-weight: 600;
    border: none;
    border-radius: 60px;
    cursor: pointer;
    transition: all 0.2s;
    margin-top: 0.5rem;
}

.login-btn:hover {
    background: #1f5068;
    transform: translateY(-1px);
}

.login-btn:active {
    transform: translateY(1px);
}

.error-message {
    background: #fee2e2;
    color: #dc2626;
    padding: 0.75rem;
    border-radius: 20px;
    margin-top: 1rem;
    text-align: center;
    font-size: 0.85rem;
    display: none;
}

/* ==================== FOOTER STYLES ==================== */
.app-footer {
    text-align: center;
    width: 100%;
    display: block;
    padding: 0.75rem;
    margin-top: 2rem;
    background: #ffffff;
    border-top: 1px solid #e2e8f0;
    font-size: 0.65rem;
    color: #64748b;
}

.app-footer p {
    margin: 0;
}

/* ==================== MOBILE RESPONSIVENESS ==================== */
@media (max-width: 768px) {
    .menu-toggle {
        display: block;
    }
    .nav-links {
        display: none;
        flex-direction: column;
        width: 100%;
        background: white;
        padding: 1rem;
        gap: 0.5rem;
        border-top: 1px solid #eef2f6;
        margin-top: 0.5rem;
    }
    .nav-links.open {
        display: flex;
    }
    .header-inner {
        flex-wrap: wrap;
        padding: 0.5rem 1rem;
    }
    .nav-links a {
        width: 100%;
        text-align: center;
        padding: 0.75rem;
        border-radius: 60px;
    }
    .lang-switcher {
        justify-content: center;
        margin: 0 auto;
    }
    button, .btn, .clock-in-btn {
        max-width: 100%;
    }
    .data-table th, .data-table td, th, td {
        padding: 0.6rem;
        font-size: 0.85rem;
    }
    .container {
        padding: 0.75rem;
    }
    .clock-in-btn, #clockOutBtn {
        padding: 1rem;
        font-size: 1.1rem;
    }
    #current-entry.card {
        font-size: 1rem;
        padding: 1rem;
    }
    .welcome-card p {
        font-size: 0.95rem;
    }
    .login-card {
        padding: 1.5rem;
    }
    .login-header h1 {
        font-size: 1.5rem;
    }
    .input-group input {
        padding: 0.75rem;
    }
    .action-buttons {
        flex-direction: column;
        gap: 0.3rem;
    }
    .btn-edit, .btn-delete {
        width: 100%;
        justify-content: center;
    }
    .form-buttons {
        flex-direction: column;
    }
    .btn-save, .btn-cancel {
        width: 100%;
        text-align: center;
    }
    .app-footer {
        padding: 1rem;
        font-size: 0.7rem;
    }
}

/* Desktop fix: ensure navigation is always visible */
@media (min-width: 769px) {
    .nav-links {
        display: flex !important;
    }
}