:root {
    --primary-color: #BEDD68;
    --primary-light: #f8fdf0;
    --primary-dark: #a8c952;
    --secondary-color: #333;
    --text-color: #333;
    --background-color: #ffffff;
    --border-color: #ddd;
    --error-color: #f44336;
    --success-color: #4caf50;
    --warning-color: #ff9800;
    --vacation-color: #e3f2fd;
    --vacation-text: #1565c0;
    --sick-color: #ffebee;
    --sick-text: #c62828;
    --sick-cert-color: #f3e5f5;
    --sick-cert-text: #7b1fa2;
}

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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, var(--primary-light) 0%, #ffffff 100%);
    color: var(--text-color);
    line-height: 1.6;
    min-height: 100vh;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* Header & Navigation */
header {
    background: white;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    margin-bottom: 30px;
}

nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 2rem;
    max-width: 1400px; /* Breiter gemacht */
    margin: 0 auto;
    min-height: 70px; /* Mindesthöhe für bessere Optik */
}

.logo {
    font-size: 1.4rem;
    font-weight: bold;
    color: var(--primary-dark);
    white-space: nowrap;
    min-width: 180px; /* Feste Mindestbreite */
}

.nav-links {
    display: flex;
    list-style: none;
    gap: 1.5rem; /* Kleinerer Gap für mehr Platz */
    flex: 1; /* Nimmt verfügbaren Platz ein */
    justify-content: center; /* Zentriert die Navigation */
    align-items: center;
    margin: 0 2rem; /* Abstand zu Logo und User-Info */
}

.nav-links a {
    text-decoration: none;
    color: var(--text-color);
    font-weight: 500;
    font-size: 0.95rem; /* Etwas kleinere Schrift */
    transition: color 0.3s ease;
    white-space: nowrap;
    padding: 8px 12px; /* Padding für bessere Klickfläche */
    border-radius: 6px;
    transition: all 0.3s ease;
}

.nav-links a:hover,
.nav-links a.active {
    color: var(--primary-dark);
    background: var(--primary-light);
}

.user-info {
    display: flex;
    align-items: center;
    gap: 0.8rem; /* Kleinerer Gap */
    white-space: nowrap;
    min-width: 200px; /* Feste Mindestbreite */
    justify-content: flex-end;
}

.user-info span {
    font-size: 0.9rem; /* Kleinere Schrift */
}

.user-info .btn {
    padding: 8px 16px; /* Kleinerer Button */
    font-size: 0.9rem;
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 12px 24px;
    background: var(--primary-color);
    color: white;
    text-decoration: none;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.btn:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

.btn:active {
    transform: translateY(0);
}

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

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

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

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

.btn-large {
    padding: 20px 40px;
    font-size: 1.2rem;
    min-width: 200px;
    min-height: 80px;
}

/* Page Header */
.page-header {
    text-align: center;
    margin-bottom: 30px;
    padding: 20px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.page-header h1 {
    margin: 0 0 10px 0;
    color: var(--primary-dark);
}

.page-header p {
    margin: 0;
    color: #666;
    font-size: 1.1rem;
}

/* Cards */
.card {
    background: white;
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    margin-bottom: 24px;
    border: 1px solid var(--border-color);
}

.card-header {
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 16px;
    color: var(--primary-dark);
    border-bottom: 2px solid var(--primary-light);
    padding-bottom: 8px;
}

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

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

.form-control {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.3s ease;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(190, 221, 104, 0.1);
}

/* PIN Pad */
.pin-pad {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
    max-width: 300px;
    margin: 0 auto;
    padding: 0 10px;
}

.pin-btn {
    aspect-ratio: 1;
    background: white;
    border: 2px solid var(--border-color);
    border-radius: 12px;
    font-size: 2rem;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    min-height: 60px;
}

.pin-btn:hover {
    background: var(--primary-light);
    border-color: var(--primary-color);
    transform: translateY(-2px);
}

.pin-btn:active {
    transform: translateY(0);
    background: var(--primary-color);
    color: white;
}

.pin-display {
    text-align: center;
    font-size: 2rem;
    margin: 20px 0;
    letter-spacing: 10px;
}

.pin-zero {
    /* Grid position nicht mehr explizit gesetzt - bleibt in natürlicher Reihenfolge */
}

.pin-clear {
    background: var(--error-color);
    color: white;
    font-size: 1.2rem;
}

.pin-clear:hover {
    background: #d32f2f;
}

/* Dashboard Grid */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 24px;
    margin-bottom: 30px;
}

.time-tracking-buttons {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
    margin-bottom: 20px;
}

/* Calendar */
.calendar-container {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

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

.calendar-header h2 {
    margin: 0;
}

.calendar-nav-btn {
    background: rgba(255,255,255,0.2);
    border: none;
    color: white;
    padding: 10px 15px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1.2rem;
    transition: background 0.3s ease;
}

.calendar-nav-btn:hover {
    background: rgba(255,255,255,0.3);
}

.calendar-grid {
    display: grid;
    grid-template-columns: 200px 1fr;
    max-height: 80vh;
    overflow: auto;
}

.employee-column {
    background: var(--primary-light);
    border-right: 1px solid var(--border-color);
}

.employee-header {
    padding: 15px;
    font-weight: bold;
    background: var(--primary-color);
    color: white;
    text-align: center;
}

.employee-name {
    padding: 15px;
    border-bottom: 1px solid var(--border-color);
    background: white;
    font-weight: 500;
}

.days-grid {
    display: grid;
    grid-template-columns: repeat(31, 1fr);
    min-width: 1000px;
}

.day-header {
    padding: 15px 8px;
    text-align: center;
    font-weight: bold;
    background: var(--primary-color);
    color: white;
    border-right: 1px solid rgba(255,255,255,0.2);
}

.day-cell {
    min-height: 50px;
    border: 1px solid var(--border-color);
    cursor: pointer;
    position: relative;
    padding: 4px;
    font-size: 0.8rem;
    transition: all 0.3s ease;
}

.day-cell:hover {
    background: var(--primary-light);
}

.status-vacation {
    background: var(--vacation-color);
    color: var(--vacation-text);
}

.status-sick {
    background: var(--sick-color);
    color: var(--sick-text);
}

.status-sick-certificate {
    background: var(--sick-cert-color);
    color: var(--sick-cert-text);
}

/* Fullscreen Button */
.fullscreen-btn {
    position: fixed;
    top: 15px;
    right: 15px;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 8px;
    padding: 12px 16px;
    font-size: 18px;
    cursor: pointer;
    z-index: 99999;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
    transition: all 0.3s ease;
    min-width: 50px;
    min-height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.fullscreen-btn:hover {
    background: var(--primary-dark);
    transform: translateY(-2px) scale(1.05);
    box-shadow: 0 6px 16px rgba(0,0,0,0.4);
}

.fullscreen-btn:active {
    transform: translateY(0) scale(0.95);
}

/* GPS Indicator */
.gps-indicator {
    position: fixed;
    top: 20px;
    right: 80px;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: bold;
    z-index: 1000;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
    transition: all 0.3s ease;
}

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

.gps-inactive {
    background: var(--error-color);
    color: white;
}

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

/* Tables */
.table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

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

.table th {
    background: var(--primary-light);
    font-weight: 600;
    color: var(--primary-dark);
}

.table tbody tr:hover {
    background: var(--primary-light);
}

/* Status badges */
.badge {
    display: inline-block;
    padding: 3px 8px; /* Kleineres Badge für Navigation */
    border-radius: 10px;
    font-size: 0.7rem;
    font-weight: 500;
}

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

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

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

.badge-info {
    background: #17a2b8;
    color: white;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
    backdrop-filter: blur(5px);
}

.modal-content {
    background-color: white;
    margin: 10% auto;
    padding: 30px;
    border-radius: 12px;
    width: 90%;
    max-width: 500px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
    position: relative;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid var(--primary-light);
}

.modal-title {
    font-size: 1.3rem;
    font-weight: 600;
    color: var(--primary-dark);
    margin: 0;
}

.close {
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    color: #aaa;
    line-height: 1;
}

.close:hover {
    color: var(--error-color);
}

/* Alerts */
.alert {
    padding: 15px 20px;
    margin-bottom: 20px;
    border-radius: 8px;
    font-weight: 500;
}

.alert-success {
    background: rgba(76, 175, 80, 0.1);
    color: var(--success-color);
    border: 1px solid rgba(76, 175, 80, 0.3);
}

.alert-error {
    background: rgba(244, 67, 54, 0.1);
    color: var(--error-color);
    border: 1px solid rgba(244, 67, 54, 0.3);
}

.alert-warning {
    background: rgba(255, 152, 0, 0.1);
    color: var(--warning-color);
    border: 1px solid rgba(255, 152, 0, 0.3);
}

.alert-info {
    background: rgba(23, 162, 184, 0.1);
    color: #17a2b8;
    border: 1px solid rgba(23, 162, 184, 0.3);
}

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

.stat-card {
    background: white;
    padding: 20px;
    border-radius: 12px;
    text-align: center;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    border-left: 4px solid var(--primary-color);
}

.stat-value {
    font-size: 2rem;
    font-weight: bold;
    color: var(--primary-dark);
    margin-bottom: 5px;
}

.stat-label {
    color: #666;
    font-size: 0.9rem;
}

/* Loading Spinner */
.spinner {
    border: 3px solid var(--primary-light);
    border-top: 3px solid var(--primary-color);
    border-radius: 50%;
    width: 30px;
    height: 30px;
    animation: spin 1s linear infinite;
    margin: 20px auto;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Footer */
footer {
    background: white;
    padding: 20px;
    text-align: center;
    margin-top: 50px;
    box-shadow: 0 -2px 10px rgba(0,0,0,0.1);
    position: relative;
}

/* Responsive Design */
@media (max-width: 1200px) {
    nav {
        max-width: 100%;
        padding: 1rem 1.5rem;
    }
    
    .nav-links {
        gap: 1.2rem;
        margin: 0 1rem;
    }
    
    .nav-links a {
        font-size: 0.9rem;
        padding: 6px 10px;
    }
    
    .logo {
        font-size: 1.3rem;
        min-width: 160px;
    }
    
    .user-info {
        min-width: 180px;
        gap: 0.6rem;
    }
}

@media (max-width: 992px) {
    nav {
        padding: 1rem;
    }
    
    .nav-links {
        gap: 1rem;
    }
    
    .nav-links a {
        font-size: 0.85rem;
        padding: 5px 8px;
    }
    
    .logo {
        font-size: 1.2rem;
        min-width: 140px;
    }
    
    .user-info span {
        font-size: 0.85rem;
    }
    
    .user-info .btn {
        padding: 6px 12px;
        font-size: 0.85rem;
    }
}

@media (max-width: 768px) {
    .container {
        padding: 15px;
    }
    
    nav {
        flex-direction: column;
        gap: 1rem;
        padding: 1rem;
        min-height: auto;
    }
    
    .logo {
        min-width: auto;
        font-size: 1.4rem;
    }
    
    .nav-links {
        flex-wrap: wrap;
        justify-content: center;
        gap: 1rem;
        margin: 0;
    }
    
    .nav-links a {
        font-size: 0.9rem;
        padding: 8px 12px;
    }
    
    .user-info {
        min-width: auto;
        justify-content: center;
    }
    
    .dashboard-grid {
        grid-template-columns: 1fr;
    }
    
    .time-tracking-buttons {
        grid-template-columns: 1fr;
    }
    
    .btn-large {
        min-height: 60px;
        padding: 15px 30px;
    }
    
    .calendar-grid {
        grid-template-columns: 150px 1fr;
        font-size: 0.8rem;
    }
    
    .employee-header,
    .employee-name {
        padding: 10px 8px;
    }
    
    .day-header {
        padding: 10px 4px;
        font-size: 0.7rem;
    }
    
    .day-cell {
        min-height: 40px;
        font-size: 0.7rem;
        padding: 2px;
    }
    
    .modal-content {
        width: 95%;
        margin: 5% auto;
        padding: 20px;
    }
    
    .stats-grid {
        grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    }
    
    .gps-indicator {
        top: 10px;
        right: 10px;
        font-size: 10px;
        padding: 6px 12px;
    }
}

@media (max-width: 480px) {
    .pin-pad {
        max-width: 280px;
        gap: 12px;
        position: relative;
        margin: 20px auto;
    }
    
    .pin-btn {
        font-size: 1.5rem;
        min-height: 55px;
    }
    
    .pin-display {
        font-size: 1.8rem;
        margin: 15px 0;
    }
    
    .calendar-grid {
        grid-template-columns: 120px 1fr;
    }
    
    .days-grid {
        min-width: 800px;
    }

    /* Pinpad Container für bessere mobile Darstellung */
    .login-card {
        position: relative;
        overflow: visible;
        max-width: 95% !important;
        margin: 5% auto !important;
        padding: 20px !important;
    }
    
    /* Viewport anpassen für mobile Geräte */
    .container {
        padding: 10px;
    }
}

/* Utility Classes */
.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }

.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }

.d-none { display: none; }
.d-block { display: block; }
.d-flex { display: flex; }
.d-grid { display: grid; }

.justify-center { justify-content: center; }
.align-center { align-items: center; }
.gap-1 { gap: 0.5rem; }
.gap-2 { gap: 1rem; }

/* Print Styles */
@media print {
    .no-print {
        display: none !important;
    }
    
    body {
        background: white;
    }
    
    .card {
        box-shadow: none;
        border: 1px solid #ddd;
    }
    
    .btn {
        display: none;
    }
}