:root {
    /* Apple Spring Easings */
    --ease-1: cubic-bezier(0.28, 0.11, 0.32, 1);
    --ease-2: cubic-bezier(0.22, 0.61, 0.36, 1);
    --ease-out-1: cubic-bezier(0, 0, 0.58, 1);
    --ease-in-out-1: cubic-bezier(0.45, 0, 0.55, 1);

    /* Light Theme — Apple System Colors */
    --bg-light: #f5f5f7;
    --bg-glass-light: rgba(255, 255, 255, 0.72);
    --border-light: rgba(0, 0, 0, 0.06);
    --text-primary-light: #1d1d1f;
    --text-secondary-light: #86868b;
    --text-tertiary-light: #aeaeb2;
    --primary-light: #007aff;
    --primary-light-rgb: 0, 122, 255;
    --secondary-light: #34c759;
    --secondary-light-rgb: 52, 199, 89;
    --accent-light: #ff9500;
    --accent-light-rgb: 255, 149, 0;
    --card-bg-light: #ffffff;
    --shadow-light: 0 1px 3px rgba(0, 0, 0, 0.08);

    /* Dark Theme — Apple True Black */
    --bg-dark: #000000;
    --bg-glass-dark: rgba(28, 28, 30, 0.82);
    --border-dark: rgba(255, 255, 255, 0.08);
    --text-primary-dark: #f5f5f7;
    --text-secondary-dark: #98989d;
    --text-tertiary-dark: #636366;
    --primary-dark: #0a84ff;
    --primary-dark-rgb: 10, 132, 255;
    --secondary-dark: #30d158;
    --secondary-dark-rgb: 48, 209, 88;
    --accent-dark: #ff9f0a;
    --card-bg-dark: #1c1c1e;
    --card-hover-dark: #2c2c2e;
    --shadow-dark: 0 1px 4px rgba(0, 0, 0, 0.5);

    /* Shared Radii — Apple-style generous rounding */
    --border-radius-lg: 20px;
    --border-radius-md: 14px;
    --border-radius-sm: 10px;
    --card-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
    --card-shadow-hover: 0 2px 8px rgba(0, 0, 0, 0.1);

    /* Heatmap — Aliases (Light Mode defaults) */
    --accent:           var(--accent-light);
    --border:           var(--border-light);
    --border-strong:    rgba(0,0,0,0.14);
    --bg-elevated:      #ffffff;
    --text-secondary:   var(--text-secondary-light);
    --text-muted:       var(--text-tertiary-light);
    --font-ui:          -apple-system, BlinkMacSystemFont, 'SF Pro Text', sans-serif;
    --font-mono:        'JetBrains Mono', 'Courier New', monospace;
    --radius-sm:        var(--border-radius-sm);
    --shadow-md:        0 4px 16px rgba(0,0,0,0.12);
    --ease:             var(--ease-2);
    --ease-out:         var(--ease-out-1);
    --t-fast:           120ms;

    /* Day type colors (Light Mode) */
    --day-office:   rgba(99,102,241,0.20);
    --day-ho:       rgba(20,184,166,0.20);
    --day-tu:       rgba(16,185,129,0.20);
    --day-krank:    rgba(249,115,22,0.20);
    --day-pzk:      rgba(139,92,246,0.20);
    --day-bzk:      rgba(6,182,212,0.20);
    --day-lzk:      rgba(245,158,11,0.20);
    --day-feiertag: rgba(239,68,68,0.28);
}

/* Apple-style scrollbar */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.15);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 0, 0, 0.25);
}

html[data-theme='dark'] ::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.15);
}

html[data-theme='dark'] ::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.25);
}

/* Base Styles */
body {
    font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Text', 'SF Pro Display', 'Inter', 'Helvetica Neue', sans-serif;
    background-color: var(--bg-light);
    color: var(--text-primary-light);
    margin: 0;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    transition: background-color 0.3s var(--ease-1), color 0.3s var(--ease-1);
    -webkit-tap-highlight-color: transparent;
}

html[data-theme='dark'] {
    --accent:           var(--accent-dark);
    --border:           var(--border-dark);
    --border-strong:    rgba(255,255,255,0.14);
    --bg-elevated:      #2c2c2e;
    --text-secondary:   var(--text-secondary-dark);
    --text-muted:       var(--text-tertiary-dark);
    --shadow-md:        0 4px 16px rgba(0,0,0,0.55);
    --day-office:   rgba(99,102,241,0.30);
    --day-ho:       rgba(20,184,166,0.30);
    --day-tu:       rgba(16,185,129,0.30);
    --day-krank:    rgba(249,115,22,0.30);
    --day-pzk:      rgba(139,92,246,0.28);
    --day-bzk:      rgba(6,182,212,0.28);
    --day-lzk:      rgba(245,158,11,0.28);
    --day-feiertag: rgba(239,68,68,0.38);
}

html[data-theme='dark'] body {
    background-color: var(--bg-dark);
    color: var(--text-primary-dark);
}

.app-container {
    display: flex;
    min-height: 100vh;
}

/* Sidebar — Apple Style */
.sidebar {
    width: 72px;
    padding: 20px 0;
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
    background: var(--bg-glass-light);
    backdrop-filter: blur(24px) saturate(190%);
    -webkit-backdrop-filter: blur(24px) saturate(190%);
    border-right: 0.5px solid var(--border-light);
    transition: all 0.3s var(--ease-1);
    z-index: 100;
}

html[data-theme='dark'] .sidebar {
    background: var(--bg-glass-dark);
    border-right: 0.5px solid var(--border-dark);
}

.sidebar-top,
.sidebar-bottom {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.brand .user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: #e8e8ed;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    color: var(--text-secondary-light);
    font-size: 14px;
    transition: background-color 0.2s var(--ease-1);
}

html[data-theme='dark'] .brand .user-avatar {
    background: #3a3a3c;
    color: var(--text-secondary-dark);
}

nav {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-top: 24px;
}

.nav-link {
    width: 44px;
    height: 44px;
    border-radius: var(--border-radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-tertiary-light);
    text-decoration: none;
    position: relative;
    transition: color 0.2s var(--ease-2), background-color 0.2s var(--ease-2);
    background: none;
    border: none;
    cursor: pointer;
    font-family: inherit;
}

html[data-theme='dark'] .nav-link {
    color: var(--text-tertiary-dark);
}

.nav-link:hover {
    background-color: rgba(0, 0, 0, 0.04);
    color: var(--text-primary-light);
}

html[data-theme='dark'] .nav-link:hover {
    background-color: rgba(255, 255, 255, 0.06);
    color: var(--text-primary-dark);
}

.nav-link.active {
    background-color: rgba(var(--primary-light-rgb), 0.1);
    color: var(--primary-light);
}

html[data-theme='dark'] .nav-link.active {
    background-color: rgba(var(--primary-dark-rgb), 0.15);
    color: var(--primary-dark);
}

.nav-link .material-icons-outlined {
    font-size: 22px;
    transition: none;
}

.nav-link:hover .material-icons-outlined {
    transform: none;
}

/* Sidebar Tooltip */
.nav-link::after {
    content: attr(title);
    position: absolute;
    left: 64px;
    top: 50%;
    transform: translateY(-50%) translateX(-6px);
    background: var(--card-bg-light);
    color: var(--text-primary-light);
    padding: 6px 12px;
    border-radius: 8px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
    white-space: nowrap;
    z-index: 101;
    font-weight: 500;
    font-size: 13px;
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s var(--ease-2);
}

html[data-theme='dark'] .nav-link::after {
    background: #2c2c2e;
    color: var(--text-primary-dark);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
    border: 0.5px solid var(--border-dark);
}

.nav-link:hover::after {
    opacity: 1;
    visibility: visible;
    transform: translateY(-50%) translateX(0);
}

/* Calendar Selection Toggle in Navigation */
.calendar-selection-toggle {
    position: relative;
    cursor: pointer;
}

.calendar-selection-toggle input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.calendar-selection-toggle .selection-toggle-icon {
    transition: color 0.2s var(--ease-2);
}

.calendar-selection-toggle input[type="checkbox"]:checked ~ .selection-toggle-icon {
    color: var(--primary-light);
}

html[data-theme='dark'] .calendar-selection-toggle input[type="checkbox"]:checked ~ .selection-toggle-icon {
    color: var(--primary-dark);
}

.calendar-selection-toggle:hover .selection-toggle-icon {
    transform: none;
}

/* Theme Switch — Apple Toggle */
.theme-switch {
    position: relative;
    display: inline-block;
    width: 46px;
    height: 28px;
    cursor: pointer;
}

.theme-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.theme-switch .slider {
    position: absolute;
    inset: 0;
    background-color: rgba(120, 120, 128, 0.16);
    border-radius: 28px;
    transition: background-color 0.25s var(--ease-1);
}

html[data-theme='dark'] .theme-switch .slider {
    background-color: rgba(120, 120, 128, 0.32);
}

.theme-switch .slider::before {
    position: absolute;
    content: "";
    height: 24px;
    width: 24px;
    left: 2px;
    bottom: 2px;
    background-color: white;
    border-radius: 50%;
    transition: transform 0.25s var(--ease-1);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.15), 0 0 1px rgba(0, 0, 0, 0.1);
}

.theme-switch .slider .theme-icon {
    position: absolute;
    left: 5px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 16px;
    color: #8e8e93;
    pointer-events: none;
    transition: all 0.25s var(--ease-1);
    z-index: 1;
}

input:checked+.slider {
    background-color: var(--primary-dark);
}

input:checked+.slider::before {
    transform: translateX(18px);
}

input:checked+.slider .theme-icon {
    transform: translate(18px, -50%);
    color: #ffd60a;
}

/* Main Content Area */
#main-content {
    margin-left: 72px;
    flex: 1;
    padding: 32px 40px;
    transition: margin-left 0.3s var(--ease-1);
    display: flex;
    flex-direction: column;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
}

/* Main view transitions — Apple Spring */
.view {
    animation: viewEnter 0.35s var(--ease-1) forwards;
    max-width: 1400px;
    margin: 0 auto;
}

.view.exiting {
    animation: viewExit 0.2s var(--ease-1) forwards;
    pointer-events: none;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(8px);
    }
    to {
        opacity: 1;
        transform: none;
    }
}

@keyframes fadeOut {
    from { opacity: 1; }
    to { opacity: 0; }
}

@keyframes viewEnter {
    from {
        opacity: 0;
        transform: translateY(12px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes viewExit {
    from {
        opacity: 1;
        transform: translateY(0);
    }
    to {
        opacity: 0;
        transform: translateY(-6px);
    }
}

@keyframes cardEntrance {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes cardEntranceSlideUp {
    from {
        opacity: 0;
        transform: translateY(16px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes slideOutRight {
    from {
        opacity: 1;
        transform: translateX(0);
    }
    to {
        opacity: 0;
        transform: translateX(20px);
    }
}

@keyframes pulse {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(var(--accent-light-rgb), 0.3);
    }
    50% {
        box-shadow: 0 0 0 6px rgba(var(--accent-light-rgb), 0);
    }
}

@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(12px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideOutDown {
    from {
        opacity: 1;
        transform: translateY(0);
    }
    to {
        opacity: 0;
        transform: translateY(12px);
    }
}

/* Generic Card Style — Apple Flat */
.card {
    background: var(--card-bg-light);
    border-radius: var(--border-radius-lg);
    box-shadow: none;
    border: 0.5px solid var(--border-light);
    padding: 24px;
    transition: all 0.15s var(--ease-1);
    position: relative;
    overflow: hidden;
    animation: cardEntrance 0.35s var(--ease-out-1) forwards;
    opacity: 0;
}

html[data-theme='dark'] .card {
    background: var(--card-bg-dark);
    box-shadow: none;
    border: 0.5px solid rgba(255, 255, 255, 0.08);
}

.card:hover {
    background: rgba(var(--primary-light-rgb), 0.02);
}

html[data-theme='dark'] .card:hover {
    background: var(--card-hover-dark);
}

h1, h2, h3, h4, h5, h6 {
    margin: 0;
    font-weight: 600;
    color: var(--text-primary-light);
    letter-spacing: -0.01em;
}

html[data-theme='dark'] h1,
html[data-theme='dark'] h2,
html[data-theme='dark'] h3,
html[data-theme='dark'] h4,
html[data-theme='dark'] h5,
html[data-theme='dark'] h6 {
    color: var(--text-primary-dark);
}


/* Form & Input Styles */
.input-group {
    display: flex;
    gap: 16px;
}

.input-field {
    flex: 1;
}

.input-field label {
    font-size: 12px;
    font-weight: 500;
    color: var(--text-secondary-light);
    margin-bottom: 8px;
    display: block;
}

html[data-theme='dark'] .input-field label {
    color: var(--text-secondary-dark);
}

input[type="text"],
input[type="date"],
input[type="time"],
input[type="number"],
select {
    width: 100%;
    padding: 10px 14px;
    border-radius: var(--border-radius-sm);
    border: 1px solid var(--border-light);
    background-color: var(--bg-light);
    color: var(--text-primary-light);
    font-family: inherit;
    font-size: 15px;
    transition: border-color 0.2s var(--ease-2), box-shadow 0.2s var(--ease-2);
    box-sizing: border-box;
}

html[data-theme='dark'] input[type="text"],
html[data-theme='dark'] input[type="date"],
html[data-theme='dark'] input[type="time"],
html[data-theme='dark'] input[type="number"],
html[data-theme='dark'] select {
    border-color: var(--border-dark);
    background-color: rgba(255, 255, 255, 0.05);
    color: var(--text-primary-dark);
}

input:focus,
select:focus {
    outline: none;
    border-color: var(--primary-light);
    box-shadow: 0 0 0 4px rgba(var(--primary-light-rgb), 0.15);
}

html[data-theme='dark'] input:focus,
html[data-theme='dark'] select:focus {
    border-color: var(--primary-dark);
    box-shadow: 0 0 0 4px rgba(var(--primary-dark-rgb), 0.2);
}


/* Button Styles — Apple */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 20px;
    border-radius: 980px;
    font-family: inherit;
    font-size: 14px;
    font-weight: 500;
    border: none;
    cursor: pointer;
    transition: opacity 0.2s var(--ease-2), transform 0.1s var(--ease-2), background-color 0.2s var(--ease-2);
    user-select: none;
}

.btn:active {
    transform: scale(0.97);
}

.btn .material-icons-outlined {
    font-size: 18px;
}

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

html[data-theme='dark'] .btn-primary {
    background-color: var(--primary-dark);
    color: white;
}

.btn-primary:hover {
    opacity: 0.88;
}

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

html[data-theme='dark'] .btn-secondary {
    background-color: var(--secondary-dark);
    color: white;
}

.btn-secondary:hover {
    opacity: 0.88;
}

.btn-outlined {
    background-color: transparent;
    border: 1px solid var(--border-light);
    color: var(--text-primary-light);
}

html[data-theme='dark'] .btn-outlined {
    border-color: var(--border-dark);
    color: var(--text-primary-dark);
}

.btn-outlined:hover {
    background-color: rgba(0, 0, 0, 0.03);
}

html[data-theme='dark'] .btn-outlined:hover {
    background-color: rgba(255, 255, 255, 0.06);
}

.btn-subtle {
    background-color: transparent;
    color: var(--text-secondary-light);
}

html[data-theme='dark'] .btn-subtle {
    color: var(--text-secondary-dark);
}

.btn-subtle:hover {
    background-color: rgba(0, 0, 0, 0.04);
    color: var(--text-primary-light);
}

html[data-theme='dark'] .btn-subtle:hover {
    background-color: rgba(255, 255, 255, 0.08);
    color: var(--text-primary-dark);
}


/* Stempeluhr View Specifics */
.stempeluhr-view .header-grid {
    display: grid;
    grid-template-columns: 1fr 1fr 1.4fr;
    gap: 20px;
    margin-bottom: 8px;
    align-items: stretch;
}

/* Section Labels — Apple uppercase micro-labels */
.section-label {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-secondary-light);
}

html[data-theme='dark'] .section-label {
    color: var(--text-secondary-dark);
}

.month-calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 4px;
}

.month-day-label {
    text-align: center;
    font-size: 11px;
    font-weight: 600;
    color: var(--text-secondary-light);
    padding: 4px 0;
}

.greeting-card {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    cursor: pointer;
    animation: cardEntrance 0.4s var(--ease-out-1) forwards;
    animation-delay: 0.05s;
    opacity: 0;
}

.greeting-card h2 {
    color: var(--text-secondary-light);
    font-size: 1rem;
    font-weight: 400;
    margin-bottom: 4px;
}

html[data-theme='dark'] .greeting-card {
    background: var(--card-bg-dark);
    border: 1px solid var(--border-dark);
}

html[data-theme='dark'] .greeting-card h2 {
    color: var(--text-secondary-dark);
}

.current-time {
    font-size: 4rem;
    font-weight: 200;
    line-height: 1.1;
    letter-spacing: -0.03em;
    color: var(--text-primary-light);
    position: relative;
    z-index: 1;
    margin-top: 4px;
    margin-bottom: 8px;
}

html[data-theme='dark'] .current-time {
    color: var(--text-primary-dark);
}

.current-date {
    font-size: 0.85rem;
    font-weight: 400;
    color: var(--text-secondary-light);
    position: relative;
    z-index: 1;
}

html[data-theme='dark'] .current-date {
    color: var(--text-secondary-dark);
}

.time-entry-card .time-entry-header {
    margin-bottom: 16px;
}

.time-entry-card .input-group {
    margin-bottom: 20px;
}

.time-entry-card .button-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

/* Shortcut hints on buttons */
.shortcut-hint {
    margin-left: 6px;
    padding: 1px 5px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 4px;
    font-size: 10px;
    font-weight: 500;
    opacity: 0.6;
}

html[data-theme="dark"] .shortcut-hint {
    background: rgba(255, 255, 255, 0.1);
}

/* Flash animation for stamp buttons — Apple subtle */
.btn.flash {
    animation: btn-flash 400ms var(--ease-1);
}

@keyframes btn-flash {
    0% { transform: scale(1); opacity: 1; }
    30% { transform: scale(0.95); opacity: 0.7; }
    100% { transform: scale(1); opacity: 1; }
}

.stats-bar {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0;
    padding: 20px 0;
    margin-bottom: 8px;
    animation: cardEntrance 0.4s var(--ease-out-1) forwards;
    animation-delay: 0.1s;
    opacity: 0;
}

.stats-bar .stats-divider {
    width: 1px;
    height: 32px;
    background: var(--border-light);
    margin: 0 8px;
}

html[data-theme='dark'] .stats-bar .stats-divider {
    background: var(--border-dark);
}

.stats-card {
    padding: 24px;
    animation: cardEntrance 0.4s var(--ease-out-1) forwards;
    animation-delay: 0.15s;
    opacity: 0;
    margin-bottom: 24px;
}

.stats-card .stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 32px;
    text-align: center;
}

/* History Section — No card wrapper */
.history-section {
    animation: cardEntrance 0.4s var(--ease-out-1) forwards;
    animation-delay: 0.15s;
    opacity: 0;
}

.history-section .section-label {
    display: block;
    margin-bottom: 16px;
}

.stat-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 12px;
    border-radius: var(--border-radius-md);
    background: transparent;
    transition: background-color 0.2s var(--ease-1);
}

html[data-theme='dark'] .stat-item {
    background: transparent;
}

.stat-item:hover {
    background: rgba(0, 0, 0, 0.02);
}

html[data-theme='dark'] .stat-item:hover {
    background: rgba(255, 255, 255, 0.03);
}

.stat-item .stat-label {
    font-size: 11px;
    font-weight: 500;
    color: var(--text-secondary-light);
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

html[data-theme='dark'] .stat-item .stat-label {
    color: var(--text-secondary-dark);
}

.stat-item .stat-value {
    font-size: 1.8rem;
    font-weight: 600;
    letter-spacing: -0.02em;
    color: var(--text-primary-light);
}

html[data-theme='dark'] .stat-item .stat-value {
    color: var(--text-primary-dark);
}

.history-list {
    margin-top: 0;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.day-group .day-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    padding-bottom: 8px;
    margin-bottom: 8px;
    border-bottom: 0.5px solid var(--border-light);
}

html[data-theme='dark'] .day-group .day-header {
    border-bottom-color: var(--border-dark);
}

.day-group .day-header h4 {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary-light);
}

html[data-theme='dark'] .day-group .day-header h4 {
    color: var(--text-secondary-dark);
}

.day-header-stats {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    font-weight: 600;
}

.warning-icon {
    color: var(--accent-light);
    font-size: 18px;
}

html[data-theme='dark'] .warning-icon {
    color: var(--accent-dark);
}

.badge-ho {
    font-size: 10px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 980px;
    background-color: rgba(var(--secondary-light-rgb), 0.12);
    color: var(--secondary-light);
    margin-left: 4px;
}

html[data-theme='dark'] .badge-ho {
    background-color: rgba(var(--secondary-dark-rgb), 0.2);
    color: var(--secondary-dark);
}

.session-item.pause-item {
    background-color: transparent;
    color: var(--text-tertiary-light);
    font-size: 0.85em;
    padding: 4px 16px;
}

html[data-theme='dark'] .session-item.pause-item {
    color: var(--text-tertiary-dark);
}

.day-group .sessions-list {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.session-item {
    display: flex;
    align-items: center;
    padding: 10px 12px;
    background-color: transparent;
    border-radius: var(--border-radius-sm);
    transition: background-color 0.15s var(--ease-1);
    font-size: 14px;
}

.session-item:hover {
    background-color: rgba(0, 0, 0, 0.03);
}

html[data-theme='dark'] .session-item {
    background-color: transparent;
}

html[data-theme='dark'] .session-item:hover {
    background-color: rgba(255, 255, 255, 0.04);
}

/* Hide edit button by default, show on hover */
.session-item .edit-session-btn {
    opacity: 0;
    transition: opacity 0.15s var(--ease-1);
}

.session-item:hover .edit-session-btn {
    opacity: 1;
}

/* Highlight incomplete sessions — Apple accent dot */
.session-item.incomplete {
    background-color: rgba(var(--primary-light-rgb), 0.04);
    border-left: 2px solid var(--primary-light);
}

html[data-theme='dark'] .session-item.incomplete {
    background-color: rgba(var(--primary-dark-rgb), 0.08);
    border-left: 2px solid var(--primary-dark);
}


/* Calendar View Specifics */
.calendar-view .controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}

.year-selector {
    display: flex;
    align-items: center;
    gap: 16px;
}

.calendar-year-grid {
    display: block;
    overflow-x: auto;
    min-width: 0;
}

.month-card {
    padding: 20px;
    border-radius: var(--border-radius-lg);
    box-shadow: none;
    transition: all 0.2s var(--ease-1);
    display: flex;
    flex-direction: column;
    background: var(--card-bg-light);
    box-sizing: border-box;
    overflow: hidden;
    min-width: 280px;
    border: 0.5px solid var(--border-light);
    animation: cardEntranceSlideUp 0.4s var(--ease-out-1) forwards;
    opacity: 0;
}

.month-card:nth-child(1) { animation-delay: 0.02s; }
.month-card:nth-child(2) { animation-delay: 0.04s; }
.month-card:nth-child(3) { animation-delay: 0.06s; }
.month-card:nth-child(4) { animation-delay: 0.08s; }
.month-card:nth-child(5) { animation-delay: 0.10s; }
.month-card:nth-child(6) { animation-delay: 0.12s; }
.month-card:nth-child(7) { animation-delay: 0.14s; }
.month-card:nth-child(8) { animation-delay: 0.16s; }
.month-card:nth-child(9) { animation-delay: 0.18s; }
.month-card:nth-child(10) { animation-delay: 0.20s; }
.month-card:nth-child(11) { animation-delay: 0.22s; }
.month-card:nth-child(12) { animation-delay: 0.24s; }

html[data-theme='dark'] .month-card {
    background: var(--card-bg-dark);
    box-shadow: none;
    border: 0.5px solid rgba(255, 255, 255, 0.08);
}

.month-card:hover {
    background: rgba(var(--primary-light-rgb), 0.02);
}

html[data-theme='dark'] .month-card:hover {
    background: var(--card-hover-dark);
}

.month-header {
    text-align: center;
    margin-bottom: 16px;
}

.month-title {
    font-size: 0.8rem;
    font-weight: 600;
    margin-bottom: 12px;
    color: var(--text-secondary-light);
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

html[data-theme='dark'] .month-title {
    color: var(--text-secondary-dark);
}

.calendar-days-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 2px;
    flex-grow: 1;
    margin-bottom: 16px;
    width: 100%;
    box-sizing: border-box;
}

.weekday-header {
    text-align: center;
    font-size: 0.65rem;
    font-weight: 500;
    color: var(--text-tertiary-light, var(--text-secondary-light));
    padding: 6px 0;
    text-transform: uppercase;
    letter-spacing: 0.02em;
}

html[data-theme='dark'] .weekday-header {
    color: var(--text-secondary-dark);
}

.month-day {
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.78rem;
    font-weight: 400;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.15s var(--ease-1);
    user-select: none;
    position: relative;
    box-sizing: border-box;
    min-width: 0;
    color: var(--text-primary-light);
}

html[data-theme='dark'] .month-day {
    color: var(--text-primary-dark);
}

.month-day:hover {
    background: rgba(var(--primary-light-rgb), 0.08);
}

html[data-theme='dark'] .month-day:hover {
    background: rgba(var(--primary-dark-rgb), 0.12);
}

.month-day.empty {
    cursor: default;
}

.month-day.empty:hover {
    background: transparent;
}

.month-day.weekend {
    background: transparent;
    color: var(--text-tertiary-light, #aeaeb2);
    font-weight: 400;
    opacity: 0.5;
    cursor: default;
}

html[data-theme='dark'] .month-day.weekend {
    background: transparent;
    color: #48484a;
    opacity: 0.6;
}

.month-day.weekend:hover {
    background: transparent !important;
}

html[data-theme='dark'] .month-day.weekend:hover {
    background: transparent !important;
}

/* Feiertage - nicht änderbar */
.month-day.locked {
    cursor: not-allowed !important;
}

.month-day.locked:hover {
    transform: none !important;
}

.month-day.feiertag.locked {
    position: relative;
}

.month-day.feiertag.locked::after {
    content: '';
    position: absolute;
    bottom: 2px;
    left: 50%;
    transform: translateX(-50%);
    width: 3px;
    height: 3px;
    border-radius: 50%;
    background: currentColor;
    opacity: 0.4;
}

.month-day.today {
    background: var(--primary-light);
    color: white !important;
    font-weight: 600;
}

html[data-theme='dark'] .month-day.today {
    background: var(--primary-dark);
    color: white !important;
}

.month-day.selected {
    background-color: var(--primary-light);
    color: white;
    font-weight: 600;
}

html[data-theme='dark'] .month-day.selected {
    background-color: var(--primary-dark);
    color: white;
}


/* Day Type Colors — Apple-subtil, no borders */

/* OFFICE (Neutral) */
.month-day.office {
    background: rgba(0, 0, 0, 0.04);
    color: var(--text-primary-light);
}
html[data-theme='dark'] .month-day.office {
    background: rgba(255, 255, 255, 0.06);
    color: var(--text-primary-dark);
}

/* HOME OFFICE (Blue) */
.month-day.ho {
    background: rgba(0, 122, 255, 0.12);
    color: #007aff;
}
html[data-theme='dark'] .month-day.ho {
    background: rgba(10, 132, 255, 0.2);
    color: #0a84ff;
}

/* URLAUB (Green) */
.month-day.tu {
    background: rgba(52, 199, 89, 0.15);
    color: #248a3d;
}
html[data-theme='dark'] .month-day.tu {
    background: rgba(48, 209, 88, 0.2);
    color: #30d158;
}

/* KRANK (Orange) */
.month-day.krank {
    background: rgba(255, 149, 0, 0.15);
    color: #c93400;
}
html[data-theme='dark'] .month-day.krank {
    background: rgba(255, 159, 10, 0.2);
    color: #ff9f0a;
}

/* PZK (Purple) */
.month-day.pzk {
    background: rgba(175, 82, 222, 0.12);
    color: #8944ab;
}
html[data-theme='dark'] .month-day.pzk {
    background: rgba(191, 90, 242, 0.2);
    color: #bf5af2;
}

/* BZK (Indigo) */
.month-day.bzk {
    background: rgba(88, 86, 214, 0.12);
    color: #3634a3;
}
html[data-theme='dark'] .month-day.bzk {
    background: rgba(94, 92, 230, 0.2);
    color: #5e5ce6;
}

/* LZK (Teal) */
.month-day.lzk {
    background: rgba(0, 199, 190, 0.12);
    color: #008a87;
}
html[data-theme='dark'] .month-day.lzk {
    background: rgba(100, 210, 255, 0.15);
    color: #64d2ff;
}

/* FEIERTAG (Red) */
.month-day.feiertag {
    background: rgba(255, 59, 48, 0.12);
    color: #d70015;
}
html[data-theme='dark'] .month-day.feiertag {
    background: rgba(255, 69, 58, 0.2);
    color: #ff453a;
}

.month-day.has-data::after {
    content: '';
    position: absolute;
    bottom: 3px;
    left: 50%;
    transform: translateX(-50%);
    width: 3px;
    height: 3px;
    background: var(--primary-light);
    border-radius: 50%;
}

html[data-theme='dark'] .month-day.has-data::after {
    background: var(--primary-dark);
}

.month-day.selected {
    background: var(--primary-light) !important;
    color: white !important;
}

html[data-theme='dark'] .month-day.selected {
    background: var(--primary-dark) !important;
    color: white !important;
}

.month-day.multi-selected {
    box-shadow: 0 0 0 2px var(--primary-light);
    z-index: 10;
}

html[data-theme='dark'] .month-day.multi-selected {
    box-shadow: 0 0 0 2px var(--primary-dark);
}

/* Context Menu */
.context-menu {
    background: var(--card-bg-light);
    border: 0.5px solid var(--border-light);
    border-radius: 10px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12);
    padding: 4px;
    z-index: 2000;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
}

html[data-theme='dark'] .context-menu {
    background: rgba(44, 44, 46, 0.95);
    border: 0.5px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.4);
}

.context-menu-item {
    padding: 6px 14px;
    cursor: pointer;
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: 400;
    transition: background 0.1s;
}

.context-menu-item:hover {
    background: rgba(var(--primary-light-rgb), 0.1);
}

html[data-theme='dark'] .context-menu-item:hover {
    background: rgba(var(--primary-dark-rgb), 0.2);
}

.selection-controls {
    display: flex;
    align-items: center;
    gap: 12px;
}

.btn-small {
    padding: 6px 12px;
    font-size: 0.8rem;
}

.month-day.has-ferien::after {
    content: '';
    position: absolute;
    bottom: 2px;
    left: 50%;
    transform: translateX(-50%);
    width: 40%;
    height: 2px;
    background-color: var(--accent-light);
    border-radius: 1px;
}

html[data-theme='dark'] .month-day.has-ferien::after {
    background-color: var(--accent-dark);
}

.month-day.has-data::before {
    content: '';
    position: absolute;
    bottom: 2px;
    left: 50%;
    transform: translateX(-50%);
    width: 3px;
    height: 3px;
    border-radius: 50%;
    background-color: var(--primary-light);
}

html[data-theme='dark'] .month-day.has-data::before {
    background-color: var(--primary-dark);
}

/* Modals — Apple Sheet Style */
.modal-overlay {
    position: fixed;
    inset: 0;
    background-color: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.25s var(--ease-1), visibility 0.25s var(--ease-1);
}

.modal-overlay.visible {
    opacity: 1;
    visibility: visible;
}

.modal-overlay.visible .modal-content {
    transform: translateY(0);
    opacity: 1;
}

.modal-content {
    background: var(--card-bg-light);
    border-radius: var(--border-radius-lg);
    padding: 28px;
    width: 90%;
    max-width: 420px;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.15);
    border: none;
    transform: translateY(20px);
    opacity: 0;
    transition: all 0.3s var(--ease-1);
}

html[data-theme='dark'] .modal-content {
    background: #2c2c2e;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}

.modal-body .input-group {
    margin-bottom: 16px;
}

/* Month Stats Grid Style */
.month-stats-grid {
    display: flex;
    gap: 0;
    margin-top: auto;
    border-top: 0.5px solid var(--border-light);
    padding-top: 10px;
}

html[data-theme='dark'] .month-stats-grid {
    border-top-color: rgba(255, 255, 255, 0.06);
}

.month-stat-box {
    flex: 1;
    padding: 0;
    background: transparent;
    font-size: 11px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
}

.month-stat-box span:first-child {
    font-weight: 500;
    color: var(--text-tertiary-light, var(--text-secondary-light));
    font-size: 10px;
}

html[data-theme='dark'] .month-stat-box span:first-child {
    color: var(--text-secondary-dark);
}

.month-stat-box span:last-child {
    font-weight: 600;
    font-size: 13px;
    color: var(--text-primary-light);
}

html[data-theme='dark'] .month-stat-box span:last-child {
    color: var(--text-primary-dark);
}

.pzk-row {
    margin-top: 6px;
    font-size: 10px;
    font-weight: 500;
    color: var(--text-tertiary-light, var(--text-secondary-light));
    text-align: center;
    letter-spacing: 0.01em;
}

html[data-theme='dark'] .pzk-row {
    color: var(--text-secondary-dark);
}

.quote-progress-container {
    margin-top: 10px;
}

.quote-progress-bar {
    height: 3px;
    background: rgba(0, 0, 0, 0.06);
    border-radius: 1.5px;
    overflow: hidden;
    margin-bottom: 4px;
}

html[data-theme='dark'] .quote-progress-bar {
    background: rgba(255, 255, 255, 0.08);
}

.quote-progress-fill {
    height: 100%;
    background: var(--primary-light);
    border-radius: 1.5px;
    transition: width 0.3s var(--ease-1);
}

html[data-theme='dark'] .quote-progress-fill {
    background: var(--primary-dark);
}

/* Quarterly Summary Grid */
.quarterly-summary {
    padding: 24px !important;
}

.quarterly-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
    text-align: center;
}

.q-title {
    grid-column: 1 / -1;
    font-weight: 700;
    font-size: 1.1rem;
    margin-bottom: 12px;
    color: var(--text-primary-light);
}

html[data-theme='dark'] .q-title {
    color: var(--text-primary-dark);
}

.q-stat {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.q-stat label {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    color: var(--text-secondary-light);
    letter-spacing: 0.05em;
}

html[data-theme='dark'] .q-stat label {
    color: var(--text-secondary-dark);
}

.q-stat .value {
    font-size: 2rem;
    font-weight: 800;
    color: var(--text-primary-light);
}

html[data-theme='dark'] .q-stat .value {
    color: var(--text-primary-dark);
}

/* Floating Action Menu */
.floating-action-menu {
    position: fixed;
    bottom: 32px;
    right: 32px;
    background: var(--card-bg-light);
    padding: 10px 18px;
    border-radius: 980px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.12);
    display: flex;
    align-items: center;
    gap: 12px;
    z-index: 1000;
    border: 0.5px solid var(--border-light);
    transition: all 0.35s var(--ease-1);
    transform: translateY(150%);
    opacity: 0;
    pointer-events: none;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
}

html[data-theme='dark'] .floating-action-menu {
    background: rgba(28, 28, 30, 0.9);
    border: 0.5px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
}

.floating-action-menu.visible {
    transform: translateY(0);
    opacity: 1;
    pointer-events: all;
}

.floating-action-menu .count-badge {
    background: var(--primary-light);
    color: white;
    padding: 3px 10px;
    border-radius: 980px;
    font-weight: 600;
    font-size: 0.8rem;
}

html[data-theme='dark'] .floating-action-menu .count-badge {
    background: var(--primary-dark);
}

/* Footer Section */
.app-footer {
    margin-top: auto;
    padding: 12px 20px;
    border-top: 0.5px solid var(--border-light);
    background: transparent;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

html[data-theme='dark'] .app-footer {
    border-top-color: rgba(255, 255, 255, 0.06);
}

.app-footer .footer-section {
    display: flex;
    gap: 8px;
    align-items: center;
}

.app-footer .footer-label {
    font-size: 0.65rem;
    font-weight: 500;
    color: var(--text-tertiary-light, var(--text-secondary-light));
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-right: 4px;
}

html[data-theme='dark'] .app-footer .footer-label {
    color: var(--text-secondary-dark);
}

.btn-small {
    padding: 5px 10px !important;
    font-size: 0.7rem !important;
    border-radius: 980px !important;
}

.btn-outlined.active {
    background: rgba(76, 175, 80, 0.08);
    border-color: #4caf50;
    color: #2e7d32;
}

html[data-theme='dark'] .btn-outlined.active {
    background: rgba(76, 175, 80, 0.15);
    border-color: #66bb6a;
    color: #a5d6a7;
}

/* Input Overwrite */
.controls input[type="number"] {
    width: 60px !important;
    padding: 6px 10px !important;
    border-radius: 8px;
    border: 0.5px solid var(--border-light);
    background: var(--card-bg-light);
    font-weight: 500;
    font-size: 0.85rem;
    font-family: inherit;
    color: var(--text-primary-light);
    -webkit-font-smoothing: antialiased;
}

html[data-theme='dark'] .controls input[type="number"] {
    border-color: rgba(255, 255, 255, 0.1);
    background: var(--card-bg-dark);
    color: var(--text-primary-dark);
}


.quarterly-separator {
    grid-column: 1 / -1;
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 12px 0;
    margin: 4px 0;
}

.separator-line {
    flex-grow: 1;
    height: 0.5px;
    background: var(--border-light);
}

html[data-theme='dark'] .separator-line {
    background: rgba(255, 255, 255, 0.08);
}

.separator-label {
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--text-tertiary-light, var(--text-secondary-light));
    white-space: nowrap;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    display: flex;
    align-items: center;
    gap: 10px;
}

html[data-theme='dark'] .separator-label {
    color: var(--text-secondary-dark);
}

.separator-stats {
    font-size: 0.7rem;
    font-weight: 500;
    color: var(--text-tertiary-light, var(--text-secondary-light));
}

html[data-theme='dark'] .separator-stats {
    color: var(--text-secondary-dark);
}

/* Highlighting Overwrites */
.month-day.today {
    background: var(--primary-light) !important;
    color: white !important;
    font-weight: 600;
    z-index: 5;
}

html[data-theme='dark'] .month-day.today {
    background: var(--primary-dark) !important;
    color: white !important;
}

.legend-card {
    background: transparent;
    box-shadow: none;
    border: none;
    padding: 0 !important;
    margin-bottom: 16px !important;
}

html[data-theme='dark'] .legend-card {
    background: transparent;
    box-shadow: none;
    border: none;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: 980px;
    background: transparent;
    transition: opacity 0.15s var(--ease-1);
    font-weight: 500;
    font-size: 0.75rem;
    color: var(--text-secondary-light);
}

.legend-item:hover {
    opacity: 0.7;
}

html[data-theme='dark'] .legend-item {
    color: var(--text-secondary-dark);
}

.legend-color {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    border: none;
}

/* Legend colors — matching day type colors */
.legend-color.office {
    background: rgba(0, 0, 0, 0.15);
}
html[data-theme='dark'] .legend-color.office {
    background: rgba(255, 255, 255, 0.2);
}

.legend-color.ho {
    background: #007aff;
}
html[data-theme='dark'] .legend-color.ho {
    background: #0a84ff;
}

.legend-color.tu {
    background: #34c759;
}
html[data-theme='dark'] .legend-color.tu {
    background: #30d158;
}

.legend-color.krank {
    background: #ff9500;
}
html[data-theme='dark'] .legend-color.krank {
    background: #ff9f0a;
}

.legend-color.pzk {
    background: #af52de;
}
html[data-theme='dark'] .legend-color.pzk {
    background: #bf5af2;
}

.legend-color.bzk {
    background: #5856d6;
}
html[data-theme='dark'] .legend-color.bzk {
    background: #5e5ce6;
}

.legend-color.lzk {
    background: #00c7be;
}
html[data-theme='dark'] .legend-color.lzk {
    background: #64d2ff;
}

.legend-color.feiertag {
    background: #ff3b30;
}
html[data-theme='dark'] .legend-color.feiertag {
    background: #ff453a;
}

.modal-footer {
    margin-top: 24px;
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}

/* Modal Body Select Styling for Dark Theme */
html[data-theme='dark'] .modal-body select {
    background-color: var(--card-bg-dark);
    color: white;
}

@media (max-width: 1200px) {
    .stempeluhr-view .header-grid {
        grid-template-columns: 1fr;
    }

    #main-content {
        padding: 24px 20px;
    }
}

@media (max-width: 768px) {
    body {
        padding-bottom: 84px;
    }

    .sidebar {
        top: auto;
        bottom: 0;
        left: 0;
        right: 0;
        width: 100%;
        height: 78px;
        padding: 0 8px;
        padding-bottom: env(safe-area-inset-bottom, 0px);
        flex-direction: row;
        border-right: none;
        border-top: 0.5px solid var(--border-light);
        box-shadow: none;
        backdrop-filter: blur(24px) saturate(180%);
        -webkit-backdrop-filter: blur(24px) saturate(180%);
        background: rgba(255, 255, 255, 0.85);
        justify-content: center;
    }

    html[data-theme='dark'] .sidebar {
        border-top: 0.5px solid rgba(255, 255, 255, 0.08);
        box-shadow: none;
        background: rgba(0, 0, 0, 0.85);
    }

    .sidebar-top,
    .sidebar-bottom {
        flex-direction: row;
        margin-top: 0;
        gap: 0;
    }

    .sidebar-top {
        flex: 1;
    }

    .sidebar-bottom {
        flex: 0;
    }

    nav {
        flex-direction: row;
        gap: 0;
        flex: 1;
        justify-content: space-around;
    }

    .brand {
        display: none;
    }

    .nav-link {
        min-width: 44px;
        min-height: 44px;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .nav-link::after {
        display: none;
    }

    /* Hide non-essential sidebar items on mobile */
    .sidebar-bottom .nav-link,
    .sidebar-bottom .theme-switch,
    #calendar-selection-control {
        display: none !important;
    }

    /* Keep only the theme toggle visible */
    .sidebar-bottom .theme-switch {
        display: flex !important;
    }

    #main-content {
        margin-left: 0;
        padding: 12px 12px;
    }

    .stats-bar {
        flex-wrap: wrap;
        gap: 0;
    }

    .stats-bar .stats-divider {
        display: none;
    }

    .stats-bar .stat-item {
        flex: 1 0 45%;
    }

    .stempeluhr-view .header-grid {
        grid-template-columns: 1fr;
        gap: 8px;
    }

    /* Kompakte Greeting Card auf Mobile */
    .greeting-card {
        padding: 8px 14px;
    }

    .greeting-card h2 {
        font-size: 0.78rem;
        margin-bottom: 0;
    }

    .current-time {
        font-size: 2rem;
        margin-top: 0;
        margin-bottom: 0;
        letter-spacing: -0.02em;
    }

    .current-date {
        font-size: 0.72rem;
        margin-bottom: 0;
        padding: 0;
    }

    /* Kompakte Time-Entry-Card auf Mobile */
    .time-entry-card {
        padding: 10px 14px;
    }

    .time-entry-card .input-group {
        margin-bottom: 8px;
    }

    .time-entry-card .input-field label {
        font-size: 0.72rem;
    }

    .time-entry-card input[type="time"] {
        padding: 4px 8px;
        font-size: 0.85rem;
    }

    .time-entry-card .button-grid {
        gap: 6px;
    }

    .time-entry-card .button-grid .btn {
        padding: 9px 6px;
        font-size: 0.8rem;
        gap: 4px;
    }

    .time-entry-card .button-grid .btn .material-icons-outlined {
        font-size: 16px;
    }

    /* Shortcut-Hints auf Mobile ausblenden */
    .shortcut-hint {
        display: none;
    }

    /* Calendar controls stack on mobile */
    .controls {
        flex-direction: column !important;
        align-items: flex-start !important;
        gap: 12px !important;
    }

    .calendar-year-grid {
        grid-template-columns: 1fr !important;
        min-width: 0 !important;
    }

    .month-card {
        min-width: 0 !important;
    }
}
/* School Holiday Dot */
.school-holiday-stripe {
    position: absolute;
    top: 2px;
    right: 2px;
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background-color: #ff9500;
    z-index: 20;
    pointer-events: none;
}

html[data-theme='dark'] .school-holiday-stripe {
    background-color: #ff9f0a;
}

/* Ensure day creates stacking context */
.month-day {
    z-index: 1;
}

/* ===== STATISTIK VIEW ===== */

.statistik-view {
    padding: 24px;
    max-width: 1200px;
}

/* Filter Bar */
.stats-filter-card {
    margin-bottom: 20px;
    padding: 0;
    background: transparent;
    box-shadow: none;
    border: none;
}

html[data-theme='dark'] .stats-filter-card {
    background: transparent;
    box-shadow: none;
    border: none;
}

.filter-controls {
    display: flex;
    align-items: center;
    gap: 12px;
}

.filter-controls label {
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--text-secondary-light);
}

html[data-theme='dark'] .filter-controls label {
    color: var(--text-secondary-dark);
}

.filter-controls select {
    padding: 6px 12px;
    border-radius: 8px;
    border: 0.5px solid var(--border-light);
    background: var(--card-bg-light);
    color: var(--text-primary-light);
    font-size: 0.8rem;
    font-weight: 500;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.15s var(--ease-1);
    -webkit-font-smoothing: antialiased;
}

html[data-theme='dark'] .filter-controls select {
    border-color: rgba(255, 255, 255, 0.1);
    background: var(--card-bg-dark);
    color: var(--text-primary-dark);
}

.filter-controls select:focus {
    outline: none;
    border-color: var(--primary-light);
}

html[data-theme='dark'] .filter-controls select:focus {
    border-color: var(--primary-dark);
}

/* KPI Cards */
.kpi-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    margin-bottom: 20px;
}

.kpi-card {
    background: var(--card-bg-light);
    border-radius: var(--border-radius-md);
    padding: 16px;
    box-shadow: none;
    border: 0.5px solid var(--border-light);
    display: flex;
    gap: 0;
    align-items: stretch;
    flex-direction: column;
    transition: all 0.15s var(--ease-1);
    animation: cardEntranceSlideUp 0.35s var(--ease-out-1) forwards;
    opacity: 0;
}

.kpi-card:nth-child(1) { animation-delay: 0.02s; }
.kpi-card:nth-child(2) { animation-delay: 0.04s; }
.kpi-card:nth-child(3) { animation-delay: 0.06s; }
.kpi-card:nth-child(4) { animation-delay: 0.08s; }

html[data-theme='dark'] .kpi-card {
    background: var(--card-bg-dark);
    box-shadow: none;
    border: 0.5px solid rgba(255, 255, 255, 0.08);
}

.kpi-card:hover {
    background: rgba(var(--primary-light-rgb), 0.02);
}

html[data-theme='dark'] .kpi-card:hover {
    background: var(--card-hover-dark);
}

.kpi-icon {
    display: none;
}

.kpi-content {
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex: 1;
}

.kpi-label {
    font-size: 0.65rem;
    font-weight: 500;
    color: var(--text-secondary-light);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

html[data-theme='dark'] .kpi-label {
    color: var(--text-secondary-dark);
}

.kpi-value {
    font-size: 1.5rem;
    font-weight: 200;
    color: var(--text-primary-light);
    line-height: 1;
    letter-spacing: -0.02em;
}

html[data-theme='dark'] .kpi-value {
    color: var(--text-primary-dark);
}

.kpi-trend {
    font-size: 0.65rem;
    font-weight: 500;
    margin-top: 2px;
}

.kpi-trend.positive {
    color: #34c759;
}

.kpi-trend.negative {
    color: #ff3b30;
}

.kpi-trend.neutral {
    color: var(--text-tertiary-light, var(--text-secondary-light));
}

html[data-theme='dark'] .kpi-trend.positive {
    color: #30d158;
}

html[data-theme='dark'] .kpi-trend.negative {
    color: #ff453a;
}

html[data-theme='dark'] .kpi-trend.neutral {
    color: var(--text-secondary-dark);
}

/* Stats Grid (Charts Grid) */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    margin-top: 16px;
}

.chart-card {
    background: var(--card-bg-light);
    padding: 16px;
    border-radius: var(--border-radius-md);
    box-shadow: none;
    border: 0.5px solid var(--border-light);
    transition: all 0.15s var(--ease-1);
    animation: cardEntranceSlideUp 0.35s var(--ease-out-1) forwards;
    opacity: 0;
}

.chart-card:nth-child(1) { animation-delay: 0.10s; }
.chart-card:nth-child(2) { animation-delay: 0.12s; }
.chart-card:nth-child(3) { animation-delay: 0.14s; }
.chart-card:nth-child(4) { animation-delay: 0.16s; }
.chart-card:nth-child(5) { animation-delay: 0.18s; }
.chart-card:nth-child(6) { animation-delay: 0.20s; }

html[data-theme='dark'] .chart-card {
    background: var(--card-bg-dark);
    box-shadow: none;
    border: 0.5px solid rgba(255, 255, 255, 0.08);
}

.chart-card:hover {
    background: rgba(var(--primary-light-rgb), 0.02);
}

html[data-theme='dark'] .chart-card:hover {
    background: var(--card-hover-dark);
}

.chart-card-wide {
    grid-column: 1 / -1;
}

.chart-card h3 {
    margin: 0 0 12px 0;
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--text-secondary-light);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

html[data-theme='dark'] .chart-card h3 {
    color: var(--text-secondary-dark);
}

.chart-card canvas {
    max-height: 200px;
}

/* Vacation Progress */
.vacation-progress {
    padding: 0;
}

.vacation-stats {
    font-size: 1.4rem;
    font-weight: 200;
    margin-bottom: 10px;
    color: var(--text-primary-light);
    letter-spacing: -0.02em;
}

html[data-theme='dark'] .vacation-stats {
    color: var(--text-primary-dark);
}

.vacation-taken {
    font-weight: 400;
    color: var(--primary-light);
}

html[data-theme='dark'] .vacation-taken {
    color: var(--primary-dark);
}

.progress-bar-track {
    height: 6px;
    background: rgba(0, 0, 0, 0.06);
    border-radius: 3px;
    overflow: hidden;
    margin-bottom: 10px;
}

html[data-theme='dark'] .progress-bar-track {
    background: rgba(255, 255, 255, 0.08);
}

.progress-bar-fill {
    height: 100%;
    background: var(--primary-light);
    transition: width 0.4s var(--ease-1);
    border-radius: 3px;
}

html[data-theme='dark'] .progress-bar-fill {
    background: var(--primary-dark);
}

.vacation-remaining {
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--text-secondary-light);
}

html[data-theme='dark'] .vacation-remaining {
    color: var(--text-secondary-dark);
}

.vacation-remaining span {
    color: #34c759;
    font-weight: 600;
}

html[data-theme='dark'] .vacation-remaining span {
    color: #30d158;
}

/* Time Bars */
.time-bars {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.time-bar-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
}

.time-bar-label {
    font-size: 0.8rem;
    font-weight: 400;
    color: var(--text-secondary-light);
}

html[data-theme='dark'] .time-bar-label {
    color: var(--text-secondary-dark);
}

.time-bar-track {
    height: 6px;
    background: rgba(0, 0, 0, 0.06);
    border-radius: 3px;
    overflow: hidden;
}

html[data-theme='dark'] .time-bar-track {
    background: rgba(255, 255, 255, 0.08);
}

.time-bar-fill {
    height: 100%;
    background: var(--primary-light);
    border-radius: 3px;
    transition: width 0.4s var(--ease-1);
}

html[data-theme='dark'] .time-bar-fill {
    background: var(--primary-dark);
}

.time-bar-value {
    font-size: 1rem;
    font-weight: 200;
    color: var(--text-primary-light);
    text-align: right;
    letter-spacing: -0.02em;
}

html[data-theme='dark'] .time-bar-value {
    color: var(--text-primary-dark);
}

/* Heatmap */
.heatmap-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 6px;
}

.heatmap-cell {
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    font-size: 0.7rem;
    font-weight: 500;
    color: #fff;
    transition: opacity 0.15s var(--ease-1);
}

.heatmap-cell:hover {
    opacity: 0.8;
}

.heatmap-time {
    user-select: none;
}

/* Respect user's motion preferences */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }

    .view,
    .view.exiting,
    .card,
    .month-card,
    .kpi-card,
    .chart-card {
        opacity: 1;
        transform: none;
    }
}

/* Responsive — Statistik */
@media (max-width: 1200px) {
    .kpi-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .stats-grid {
        grid-template-columns: 1fr;
    }

    .calendar-year-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .statistik-view {
        padding: 16px;
    }

    .kpi-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
    }

    .kpi-value {
        font-size: 1.2rem;
    }

    .stats-grid {
        grid-template-columns: 1fr;
        gap: 8px;
    }

    .time-bar-item {
        gap: 8px;
    }

    .heatmap-grid {
        grid-template-columns: repeat(auto-fit, minmax(50px, 1fr));
    }

    .chart-card {
        padding: 14px;
    }

    /* Stats filter on mobile */
    .stats-filter-card > div {
        flex-direction: column !important;
        gap: 12px !important;
        align-items: flex-start !important;
    }

    #stats-period-title {
        font-size: 1.4rem !important;
        min-width: auto !important;
    }
}

/* ── Heatmap Calendar ─────────────────────────────────────────── */
.quarterly-separator-heatmap {
    padding: 14px 0 8px;
    margin: 6px 0 10px;
    border-top: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: 14px;
}

.quarterly-separator-heatmap .q-summary {
    font-size: 10px;
    font-weight: 800;
    color: var(--accent);
    letter-spacing: 0.12em;
    text-transform: uppercase;
    background: rgba(255,159,10,0.10);
    padding: 3px 10px;
    border-radius: 20px;
    white-space: nowrap;
}

.quarterly-separator-heatmap .q-details {
    font-size: 10px;
    color: var(--text-muted);
    font-family: var(--font-mono);
    opacity: 0.8;
}

.heatmap-row {
    display: grid;
    grid-template-columns: 3.2rem repeat(31, 30px) 5rem 4rem 3.2rem;
    align-items: center;
    gap: 3px;
    padding: 2px 0;
    border-radius: 8px;
    transition: background 0.12s ease;
}

.heatmap-row:hover {
    background: rgba(128,128,128,0.04);
}

.heatmap-month-label {
    font-size: 11px;
    font-weight: 800;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    padding-right: 6px;
}

.heatmap-cell {
    width: 30px;
    height: 40px;
    border-radius: 7px;
    cursor: pointer;
    transition: transform var(--t-fast) var(--ease);
    position: relative;
    flex-shrink: 0;
    background: rgba(128,128,128,0.06);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1px;
}

.heatmap-cell:hover { transform: scale(1.18); z-index: 10; box-shadow: 0 4px 12px rgba(0,0,0,0.25); }

.heatmap-cell.empty {
    background: transparent;
    cursor: default;
    pointer-events: none;
}

.heatmap-cell.empty:hover { transform: none; }

.heatmap-cell.weekend {
    background: rgba(128,128,128,0.06);
    border: 1px solid rgba(128,128,128,0.10);
    cursor: default;
}

html[data-theme='light'] .heatmap-cell.weekend {
    background: rgba(0,0,0,0.04);
    border: 1px solid rgba(0,0,0,0.08);
}

.heatmap-cell.weekend:hover { transform: none; }

.heatmap-cell.today {
    outline: 2px solid #22d3ee;
    outline-offset: 2px;
    border-radius: 7px;
    box-shadow: 0 0 10px rgba(34,211,238,0.35);
}

.heatmap-cell.locked { cursor: not-allowed; }
.heatmap-cell.locked:hover { transform: none; }

.heatmap-cell.multi-selected {
    outline: 2px solid var(--accent);
    outline-offset: 1px;
    z-index: 5;
}

.heatmap-cell.office   { background: var(--day-office); }
.heatmap-cell.ho       { background: var(--day-ho); }
.heatmap-cell.tu       { background: var(--day-tu); }
.heatmap-cell.krank    { background: var(--day-krank); }
.heatmap-cell.pzk      { background: var(--day-pzk); }
.heatmap-cell.bzk      { background: var(--day-bzk); }
.heatmap-cell.lzk      { background: var(--day-lzk); }
.heatmap-cell.feiertag { background: var(--day-feiertag); cursor: not-allowed; }

.school-holiday-stripe {
    position: absolute;
    top: 1px; right: 1px;
    width: 4px; height: 4px;
    border-radius: 50%;
    background-color: var(--accent);
    z-index: 20;
    pointer-events: none;
}

.heatmap-at {
    font-size: 10px;
    font-family: var(--font-mono);
    font-weight: 700;
    color: var(--text-secondary);
    text-align: right;
    padding-left: 6px;
    white-space: nowrap;
    letter-spacing: 0.02em;
}

.heatmap-ho {
    font-size: 10px;
    font-family: var(--font-mono);
    font-weight: 700;
    color: #0ea5e9;
    text-align: right;
    padding-left: 4px;
    white-space: nowrap;
    letter-spacing: 0.02em;
}

.heatmap-quote {
    font-size: 10px;
    font-family: var(--font-mono);
    font-weight: 600;
    color: var(--accent);
    text-align: right;
    white-space: nowrap;
    opacity: 0.85;
}

.heatmap-cell[title]:hover::after {
    content: attr(title);
    position: absolute;
    bottom: calc(100% + 6px);
    left: 50%;
    transform: translateX(-50%);
    background: var(--bg-elevated);
    color: var(--text-primary-light);
    padding: 4px 8px;
    border-radius: var(--radius-sm);
    font-size: 11px;
    font-family: var(--font-ui);
    white-space: nowrap;
    z-index: 100;
    border: 1px solid var(--border-strong);
    box-shadow: var(--shadow-md);
    pointer-events: none;
}

html[data-theme='dark'] .heatmap-cell[title]:hover::after {
    color: var(--text-primary-dark);
}

.heatmap-cell-day {
    font-size: 11px;
    font-weight: 700;
    color: rgba(0,0,0,0.50);
    pointer-events: none;
    font-family: var(--font-mono);
    line-height: 1;
}

.heatmap-cell-wd {
    font-size: 8px;
    font-weight: 600;
    color: rgba(0,0,0,0.28);
    pointer-events: none;
    font-family: var(--font-ui);
    line-height: 1;
    letter-spacing: 0.02em;
}

html[data-theme='dark'] .heatmap-cell-day { color: rgba(255,255,255,0.70); }
html[data-theme='dark'] .heatmap-cell-wd  { color: rgba(255,255,255,0.35); }

html[data-theme='light'] .heatmap-cell-day { color: rgba(0,0,0,0.60); }
html[data-theme='light'] .heatmap-cell-wd  { color: rgba(0,0,0,0.30); }

.heatmap-cell.weekend .heatmap-cell-day { color: rgba(0,0,0,0.20); }
.heatmap-cell.weekend .heatmap-cell-wd  { color: rgba(0,0,0,0.14); }
html[data-theme='dark'] .heatmap-cell.weekend .heatmap-cell-day { color: rgba(255,255,255,0.25); }
html[data-theme='dark'] .heatmap-cell.weekend .heatmap-cell-wd  { color: rgba(255,255,255,0.15); }

.heatmap-cell.office .heatmap-cell-day, .heatmap-cell.ho .heatmap-cell-day,
.heatmap-cell.tu .heatmap-cell-day, .heatmap-cell.krank .heatmap-cell-day,
.heatmap-cell.pzk .heatmap-cell-day, .heatmap-cell.bzk .heatmap-cell-day,
.heatmap-cell.lzk .heatmap-cell-day, .heatmap-cell.feiertag .heatmap-cell-day { color: rgba(255,255,255,0.85); }

.heatmap-cell.office .heatmap-cell-wd, .heatmap-cell.ho .heatmap-cell-wd,
.heatmap-cell.tu .heatmap-cell-wd, .heatmap-cell.krank .heatmap-cell-wd,
.heatmap-cell.pzk .heatmap-cell-wd, .heatmap-cell.bzk .heatmap-cell-wd,
.heatmap-cell.lzk .heatmap-cell-wd, .heatmap-cell.feiertag .heatmap-cell-wd { color: rgba(255,255,255,0.50); }

html[data-theme='light'] .heatmap-cell.office .heatmap-cell-day,
html[data-theme='light'] .heatmap-cell.ho .heatmap-cell-day,
html[data-theme='light'] .heatmap-cell.tu .heatmap-cell-day,
html[data-theme='light'] .heatmap-cell.krank .heatmap-cell-day,
html[data-theme='light'] .heatmap-cell.pzk .heatmap-cell-day,
html[data-theme='light'] .heatmap-cell.bzk .heatmap-cell-day,
html[data-theme='light'] .heatmap-cell.lzk .heatmap-cell-day,
html[data-theme='light'] .heatmap-cell.feiertag .heatmap-cell-day { color: rgba(0,0,0,0.70); }

html[data-theme='light'] .heatmap-cell.office .heatmap-cell-wd,
html[data-theme='light'] .heatmap-cell.ho .heatmap-cell-wd,
html[data-theme='light'] .heatmap-cell.tu .heatmap-cell-wd,
html[data-theme='light'] .heatmap-cell.krank .heatmap-cell-wd,
html[data-theme='light'] .heatmap-cell.pzk .heatmap-cell-wd,
html[data-theme='light'] .heatmap-cell.bzk .heatmap-cell-wd,
html[data-theme='light'] .heatmap-cell.lzk .heatmap-cell-wd,
html[data-theme='light'] .heatmap-cell.feiertag .heatmap-cell-wd { color: rgba(0,0,0,0.45); }

.heatmap-cell:hover .heatmap-cell-day { color: rgba(255,255,255,0.95); }
