@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&family=Playfair+Display:wght@700&display=swap');

* { box-sizing: border-box; }
body { font-family: 'Inter', sans-serif; -webkit-tap-highlight-color: transparent; background: #f0f4f8; touch-action: manipulation; }
.font-serif { font-family: 'Playfair Display', serif; }

@keyframes fadeIn { from { opacity:0; transform:translateY(8px); } to { opacity:1; transform:translateY(0); } }
@keyframes slideUp { from { opacity:0; transform:translateY(40px); } to { opacity:1; transform:translateY(0); } }
@keyframes pulse-green {
    0%   { box-shadow: 0 0 0 0 rgba(52,211,153,0.7); }
    70%  { box-shadow: 0 0 0 10px rgba(52,211,153,0); }
    100% { box-shadow: 0 0 0 0 rgba(52,211,153,0); }
}
.animate-page     { animation: fadeIn  0.35s ease-out forwards; }
.animate-slide-up { animation: slideUp 0.3s cubic-bezier(.32,.72,0,1) forwards; }
.status-pulse     { animation: pulse-green 2s infinite; }

.proto-wrap { overflow-x: auto; border-radius: 24px; border: 1px solid #dde5ef; background: white; }
table.proto { width: 100%; border-collapse: collapse; min-width: 560px; }
table.proto thead th {
    background: #e8edf4; color: #15407a;
    font-size: 10px; font-weight: 800; text-transform: uppercase; letter-spacing:.06em;
    padding: 11px 14px; text-align: left; border-bottom: 2px solid #c8d8ec; white-space: nowrap;
}
table.proto thead th.r { text-align: right; }
table.proto thead th.c { text-align: center; }
table.proto td { padding: 9px 14px; border-bottom: 1px solid #edf1f6; font-size: 13px; vertical-align: middle; white-space: nowrap; }
table.proto td.r { text-align: right; }
table.proto td.c { text-align: center; }

.row-normal         { background: white; }
.row-normal:hover   { background: #f5f8fc; }
.row-weekend        { background: #f7f9fb; color: #9eafc2; }
.row-holiday        { background: #fff5f5; color: #b94040; }
.row-work           { background: #f0f7ff; }
.row-work:hover     { background: #e8f2ff; }
.row-vacation       { background: #fb7185; }
.row-vacation:hover { background: #ffe8ed; }
.row-reduction      { background: #fffbf0; }
.row-reduction:hover{ background: #fff5dc; }
.row-schlechtwetter      { background: #bbf7d0; }
.row-schlechtwetter:hover{ background: #86efac; }


.row-week-sum td {
    background: #15407a; color: white; font-weight: 700; font-size: 12px;
    padding: 9px 14px; border-bottom: 3px solid #0e2f5a;
}
.row-month-footer td {
    background: #0d2847; color: white; font-weight: 800; font-size: 13px;
    padding: 12px 14px; border-bottom: none;
}

.diff-pos  { color: #16a34a; font-weight: 700; }
.diff-neg  { color: #dc2626; font-weight: 700; }
.diff-zero { color: #94a3b8; }

.modal-backdrop {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(10, 20, 40, .7);
    -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
    z-index: 10000; display: flex; align-items: flex-start; justify-content: center;
    padding: 20px; box-sizing: border-box; overflow-y: auto; -webkit-overflow-scrolling: touch;
}

.modal-sheet {
    width: 100%; max-width: 480px; background: white; border-radius: 24px;
    display: flex; flex-direction: column; position: relative; margin: 0 auto;
    flex-shrink: 0; min-height: 100px; box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
}

@media(max-width: 639px) {
    .modal-backdrop { align-items: flex-end; padding: 0; }
    .modal-sheet {
        margin: 0 !important; width: 100% !important; max-width: 100%;
        border-radius: 24px 24px 0 0; max-height: 92vh; max-height: 92dvh;
        overflow-y: auto; padding-bottom: env(safe-area-inset-bottom);
    }
}

.proto-mobile  { display: none; }
.proto-desktop { display: block; }
@media(max-width: 639px) {
    .proto-mobile  { display: block; }
    .proto-desktop { display: none; }
}

.day-card { background: white; border-left: 4px solid #e2e8f0; padding: 11px 14px; border-bottom: 1px solid #edf1f6; }
.day-card.card-work      { border-left-color: #15407a; background: #f8fbff; }
.day-card.card-vacation { border-left-color: #e11d48; border-left-width: 5px; background: #ffd6de; }
.day-card.card-reduction { border-left-color: #d97706; background: #fffbf0; }
.day-card.card-holiday   { border-left-color: #ef4444; background: #fff5f5; }
.day-card.card-weekend   { background: #f9fafb; }
.day-card.card-schlechtwetter { border-left-color: #16a34a; background: #f0fdf4; }

.week-bar  { background: #15407a; color: white; padding: 7px 14px; font-size: 11px; font-weight: 800; display: flex; justify-content: space-between; align-items: center; letter-spacing: .04em; }
.month-bar { background: #0d2847; color: white; padding: 10px 14px; font-size: 12px; font-weight: 800; display: flex; justify-content: space-between; align-items: center; }

.nav-tab { display: flex; align-items: center; gap: 8px; padding: 11px 18px; border-radius: 14px; font-weight: 700; font-size: 12px; text-transform: uppercase; letter-spacing:.04em; cursor: pointer; transition: all .2s; border: none; font-family: 'Inter', sans-serif; }
.nav-tab.active   { background: #15407a; color: white; box-shadow: 0 4px 14px rgba(21,64,122,.25); }
.nav-tab.inactive { background: white; color: #64748b; border: 1px solid #e2e8f0; }
.nav-tab.inactive:hover { background: #f5f8fc; }

::-webkit-scrollbar       { width: 4px; height: 4px; }
::-webkit-scrollbar-thumb { background: #c8d8ec; border-radius: 10px; }

.month-btn { padding: 8px 12px; border: 1px solid #dde5ef; border-radius: 10px; background: white; cursor: pointer; color: #15407a; transition: all .15s; }
.month-btn:hover { background: #15407a; color: white; border-color: #15407a; }

/* Desktop Layout: linke Box neben dem Protokoll */
.main-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
    align-items: start;
}

@media (min-width: 1024px) {
    .main-grid {
        grid-template-columns: 300px 1fr;
    }
    .left-col {
        margin-top: 128px;
    }
    .stats-card-desktop {
        padding: 1.25rem 1.5rem !important;
        gap: 1rem !important;
    }
    .stats-card-desktop .space-y-8 > * + * {
        margin-top: 1rem !important;
    }
}
