:root {
    --primary-color: #FCC80D;
    /* Mapped from User Secondary (Accent) */
    --primary-hover: #e6b600;
    --bg-gradient-start: #2E2E2C;
    /* Mapped from User Primary (Background) */
    --bg-gradient-end: #1a1a19;
    --glass-bg: rgba(46, 46, 44, 0.4);
    --glass-border: rgba(252, 200, 13, 0.2);
    --text-color: #f1f5f9;
    --text-muted: #a0a0a0;
}

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

body {
    font-family: 'Outfit', sans-serif;
    color: var(--text-color);
    background: linear-gradient(135deg, var(--bg-gradient-start), var(--bg-gradient-end));
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow-x: hidden;
}

.glass-background {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    background: radial-gradient(circle at 50% 50%, rgba(99, 102, 241, 0.15), transparent 50%);
}

.content-wrapper {
    width: 100%;
    max-width: 1200px;
    padding: 20px;
}

/* Glass Card */
.glass-card {
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    padding: 2rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

/* Login */
.login-container {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 80vh;
}

.login-container .glass-card {
    width: 400px;
    text-align: center;
}

.subtitle {
    color: var(--text-muted);
    margin-bottom: 2rem;
}

.input-group {
    position: relative;
    margin-bottom: 1.5rem;
}

.input-group input {
    width: 100%;
    padding: 12px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--glass-border);
    border-radius: 8px;
    color: var(--text-color);
    outline: none;
    transition: border-color 0.3s;
}

.input-group input:focus {
    border-color: var(--primary-color);
}

.input-group label {
    position: absolute;
    left: 12px;
    top: 12px;
    color: var(--text-muted);
    pointer-events: none;
    transition: 0.3s;
    font-size: 0.9rem;
}

.input-group input:focus~label,
.input-group input:not(:placeholder-shown)~label {
    top: -22px;
    left: 0;
    font-size: 0.8rem;
    color: var(--primary-color);
}

.btn-primary {
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    transition: background 0.3s, transform 0.1s;
    font-family: inherit;
}

.btn-primary:hover {
    background: var(--primary-hover);
}

.btn-primary:active {
    transform: scale(0.98);
}

.btn-secondary {
    background: transparent;
    border: 1px solid var(--glass-border);
    color: var(--text-muted);
    padding: 8px 16px;
    border-radius: 8px;
    text-decoration: none;
    transition: 0.3s;
    text-align: center;
    display: inline-block;
    font-family: inherit;
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-color);
}

/* App Header & Nav */
.app-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    padding: 1rem 2rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.month-nav {
    display: flex;
    overflow-x: auto;
    gap: 0.5rem;
    padding-bottom: 4px;
}

.nav-link {
    color: var(--text-muted);
    text-decoration: none;
    padding: 6px 12px;
    border-radius: 6px;
    transition: 0.3s;
    white-space: nowrap;
}

.nav-link:hover,
.nav-link.active {
    background: rgba(255, 255, 255, 0.1);
    color: #2E2E2C;
}

.nav-link.active {
    background: var(--primary-color);
}

/* Timesheet Table */
.timesheet-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.grid-table {
    display: grid;
    grid-template-columns: 50px 60px repeat(5, 1fr) 2fr;
    gap: 1px;
    background: var(--glass-border);
    border-radius: 8px;
    overflow: hidden;
}

.grid-header {
    background: rgba(255, 255, 255, 0.1);
    padding: 12px;
    font-weight: 600;
    text-align: center;
}

.grid-row {
    display: contents;
}

.grid-cell {
    background: rgba(15, 23, 42, 0.6);
    /* Slightly darker for rows */
    padding: 8px;
}

.grid-cell.day-label {
    display: flex;
    justify-content: center;
    align-items: center;
    font-weight: bold;
    color: var(--text-muted);
}

/* Weekend Styling */
.grid-row.weekend .grid-cell {
    background: rgba(40, 40, 50, 0.8);
    /* Darker/different background for weekends */
}

.grid-row.weekend input {
    opacity: 0.7;
}

.time-input,
.text-input {
    width: 100%;
    padding: 8px;
    background: transparent;
    border: 1px solid transparent;
    border-radius: 4px;
    color: var(--text-color);
    text-align: center;
    font-family: inherit;
    transition: 0.2s;
}

.text-input {
    text-align: left;
}

.time-input:focus,
.text-input:focus {
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--primary-color);
    outline: none;
}

.grid-cell:hover .time-input,
.grid-cell:hover .text-input {
    background: rgba(255, 255, 255, 0.05);
}

/* Animations */
.fade-in {
    animation: fadeIn 0.5s ease-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Toast */
.toast {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    background: #10b981;
    color: white;
    padding: 1rem 2rem;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    transition: transform 0.3s, opacity 0.3s;
    z-index: 100;
}

.toast.hidden {
    transform: translateY(100px);
    opacity: 0;
    pointer-events: none;
}

/* Error State */
.time-input.error {
    border: 1px solid #ef4444;
    background: rgba(239, 68, 68, 0.1);
}

/* Mobile Optimization */
@media (max-width: 768px) {
    .content-wrapper {
        padding: 10px;
    }

    /* Header */
    .app-header {
        flex-direction: column;
        align-items: stretch;
        gap: 1rem;
        padding: 1rem;
    }

    .month-nav {
        flex-wrap: wrap;
        overflow-x: visible;
        justify-content: center;
        padding-bottom: 12px;
    }

    .nav-link {
        padding: 10px 16px;
        background: rgba(255, 255, 255, 0.05);
        border: 1px solid var(--glass-border);
    }

    .timesheet-header {
        flex-direction: column;
        gap: 1rem;
        align-items: flex-start;
    }

    .timesheet-header .actions {
        width: 100%;
    }

    .timesheet-header button {
        width: 100%;
    }

    /* Card Layout for Table */
    .grid-table {
        display: block;
        background: transparent;
    }

    .grid-header {
        display: none;
    }

    .grid-row {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 12px;
        background: var(--glass-bg);
        margin-bottom: 1rem;
        padding: 1.5rem;
        border-radius: 12px;
        border: 1px solid var(--glass-border);
    }

    /* Tag & Weekday */
    .grid-cell.day-label {
        background: transparent;
        justify-content: flex-start;
        font-size: 1.2rem;
        color: var(--primary-color);
        padding: 0;
        grid-column: span 1;
    }

    /* Reset generic cell styles */
    .grid-cell {
        background: transparent;
        padding: 0;
        display: flex;
        flex-direction: column;
        gap: 4px;
    }

    /* Make Note full width */
    .grid-cell.wide {
        grid-column: 1 / -1;
        margin-top: 8px;
    }

    /* Add Labels via pseudo-elements */
    /* Child 3: Start */
    .grid-row>div:nth-child(3)::before {
        content: "Start";
        font-size: 0.8rem;
        color: var(--text-muted);
    }

    /* Child 4: End */
    .grid-row>div:nth-child(4)::before {
        content: "Ende";
        font-size: 0.8rem;
        color: var(--text-muted);
    }

    /* Child 5: Pause 1 */
    .grid-row>div:nth-child(5)::before {
        content: "Pause 1";
        font-size: 0.8rem;
        color: var(--text-muted);
    }

    /* Child 6: Pause 2 */
    .grid-row>div:nth-child(6)::before {
        content: "Pause 2";
        font-size: 0.8rem;
        color: var(--text-muted);
    }

    /* Child 7: Pause 3 */
    .grid-row>div:nth-child(7)::before {
        content: "Pause 3";
        font-size: 0.8rem;
        color: var(--text-muted);
    }

    /* Child 8 Note label is already placeholder but we can add label too */
    .grid-cell.wide::before {
        content: "Abwesenheit";
        font-size: 0.8rem;
        color: var(--text-muted);
    }

    .time-input,
    .text-input {
        text-align: left;
        background: rgba(0, 0, 0, 0.2);
        padding: 12px;
    }

    /* Weekend visual tweak for cards */
    .grid-row.weekend {
        background: rgba(40, 40, 50, 0.95);
        border-left: 4px solid var(--primary-color);
    }

    /* Login Mobile */
    .login-container .glass-card {
        width: 100%;
    }
}

.btn-primary {
    color: #2E2E2C;
}