/* ============================================================
   Erfassungs-Palette + Shortcuts – Styles
   ============================================================ */
.palette-overlay {
    position: fixed; inset: 0; z-index: 1060;
    background: rgba(15, 23, 42, .42);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    display: flex; align-items: flex-start; justify-content: center;
    opacity: 0; transition: opacity .15s ease;
}
.palette-overlay.open { opacity: 1; }
.palette-overlay[hidden] { display: none; }

.palette-panel {
    position: relative;
    width: min(680px, 94vw);
    margin-top: 13vh;
    background: rgba(255, 255, 255, .94);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, .7);
    border-radius: 18px;
    box-shadow: 0 24px 64px -16px rgba(15, 23, 42, .4), 0 0 0 1px rgba(99, 102, 241, .08);
    transform: scale(.96) translateY(10px);
    transition: transform .17s cubic-bezier(.2, .9, .3, 1.4);
    overflow: hidden;
}
.palette-overlay.open .palette-panel { transform: none; }
@supports not (backdrop-filter: blur(1px)) { .palette-panel { background: #fff; } }

.palette-panel.shake { animation: pshake .3s; }
@keyframes pshake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-7px); }
    75% { transform: translateX(7px); }
}

.palette-input-row { display: flex; align-items: center; gap: .7rem; padding: 1rem 1.15rem .6rem; }
.palette-bolt { color: var(--brand); font-size: 1.15rem; }
.palette-input {
    flex: 1; border: 0; outline: 0; background: transparent;
    font-size: 1.12rem; font-weight: 500; color: var(--ink);
    caret-color: var(--brand); letter-spacing: -0.01em;
}
.palette-input::placeholder { color: var(--muted-2); font-weight: 400; }
.palette-close {
    border: 0; background: transparent; color: var(--muted-2);
    width: 1.9rem; height: 1.9rem; border-radius: .5rem; display: grid; place-items: center;
}
.palette-close:hover { background: #f1f5f9; color: var(--ink-2); }

.palette-chips { display: flex; flex-wrap: wrap; gap: .4rem; padding: 0 1.15rem .75rem; }
.pchip {
    display: inline-flex; align-items: center; gap: .38rem;
    padding: .26rem .62rem; border-radius: 999px;
    font-size: .8rem; font-weight: 600;
    animation: chippop .16s cubic-bezier(.34, 1.56, .64, 1);
}
@keyframes chippop { from { transform: scale(.7); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.pchip.is-set { background: var(--brand-soft); color: var(--brand-600); }
.pchip.is-missing { background: transparent; color: var(--muted-2); border: 1px dashed var(--line); font-weight: 500; }
.pchip.is-neutral { background: #f1f5f9; color: var(--muted); }
.pchip.is-uncertain { background: #fffbeb; color: #b45309; border: 1px dashed #f59e0b; }

.palette-preview { padding: 0 1.15rem; }
.pcard {
    display: flex; justify-content: space-between; align-items: center; gap: 1rem;
    border: 1px solid var(--line); border-left: 3px solid var(--pcolor, var(--line));
    border-radius: .7rem; padding: .5rem .8rem; margin-bottom: .45rem;
    background: #fff; animation: chippop .18s cubic-bezier(.34, 1.56, .64, 1);
    font-size: .88rem;
}
.pcard.is-invalid { border-style: dashed; opacity: .75; }
.pcard-note { display: block; color: var(--muted); font-size: .78rem; }
.pcard-hours { font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.pcard-problem { color: #b45309; font-size: .76rem; margin-right: .6rem; }
.pcard-meta { display: flex; align-items: center; white-space: nowrap; }
.pcard-total {
    text-align: right; font-size: .78rem; color: var(--muted);
    padding: .1rem .2rem .6rem; font-weight: 600;
}

.palette-list { max-height: 300px; overflow-y: auto; border-top: 1px solid var(--line); }
.palette-list:empty { border-top: 0; }
.prow {
    display: flex; align-items: center; gap: .6rem;
    padding: .55rem 1.15rem; font-size: .88rem; cursor: pointer;
    border-left: 2px solid transparent;
}
.prow:hover { background: #f8fafc; }
.prow.is-selected { background: var(--brand-soft); border-left-color: var(--brand); }
.prow-info { color: var(--muted); cursor: default; font-size: .82rem; }
.prow-info:hover { background: transparent; }
.prow-label { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.prow-right { color: var(--muted); font-size: .78rem; font-variant-numeric: tabular-nums; white-space: nowrap; }

.pkeycap {
    min-width: 1.45rem; height: 1.45rem; display: inline-grid; place-items: center;
    background: linear-gradient(180deg, #fff, #f1f5f9);
    border: 1px solid var(--line); border-bottom-width: 2px; border-radius: .38rem;
    font-size: .72rem; font-weight: 700; color: var(--ink-2);
}
.pkeycap-empty { border-color: transparent; background: transparent; }

.palette-footer {
    display: flex; justify-content: space-between; align-items: center; gap: 1rem;
    padding: .55rem 1.15rem; border-top: 1px solid var(--line);
    background: #f8fafc; font-size: .76rem; color: var(--muted);
    min-height: 2.3rem;
}
.palette-hint { flex: 1; min-width: 0; }
.palette-keys { white-space: nowrap; }
.palette-footer kbd, .cheatsheet-panel kbd {
    background: #fff; border: 1px solid var(--line); border-bottom-width: 2px;
    border-radius: 5px; padding: .04rem .34rem; font-size: .72rem; color: var(--ink-2);
    font-family: inherit;
}

.palette-success {
    position: absolute; inset: 0; display: grid; place-items: center;
    background: rgba(255, 255, 255, .85); backdrop-filter: blur(2px);
}
.palette-success svg { width: 52px; height: 52px; stroke: var(--success); stroke-width: 3.5; stroke-linecap: round; }
.palette-success circle { stroke-dasharray: 151; stroke-dashoffset: 151; animation: drawring .4s ease forwards; opacity: .35; }
.palette-success path { stroke-dasharray: 36; stroke-dashoffset: 36; animation: drawring .3s ease .15s forwards; }
@keyframes drawring { to { stroke-dashoffset: 0; } }

/* Cheatsheet */
.cheatsheet-panel { padding: 1.15rem 1.3rem; width: min(720px, 94vw); }
.cheatsheet-grid { display: grid; grid-template-columns: 1fr 1fr; gap: .4rem 2.2rem; }
@media (max-width: 700px) { .cheatsheet-grid { grid-template-columns: 1fr; } }
.cheat-section {
    font-size: .7rem; text-transform: uppercase; letter-spacing: .07em;
    color: var(--muted); font-weight: 700; margin: .8rem 0 .3rem;
}
.cheat-row { display: flex; justify-content: space-between; gap: 1rem; padding: .22rem 0; font-size: .85rem; }
.cheat-row > span:last-child { color: var(--muted); text-align: right; }
.cheat-row code { background: #f1f5f9; border-radius: .3rem; padding: .05rem .35rem; font-size: .78rem; color: var(--brand-600); }

/* Undo-Toast */
.palette-toast {
    position: fixed; left: 50%; bottom: 1.4rem; transform: translate(-50%, 1rem);
    z-index: 1070; display: flex; align-items: center; gap: .9rem;
    background: #0f172a; color: #f1f5f9; border-radius: .8rem;
    padding: .7rem 1.1rem; font-size: .87rem; box-shadow: 0 4px 16px -2px rgba(15,23,42,.3);
    opacity: 0; transition: all .25s ease; overflow: hidden;
}
.palette-toast.show { opacity: 1; transform: translate(-50%, 0); }
.palette-toast[hidden] { display: none; }
.palette-undo {
    border: 1px solid rgba(148, 163, 184, .4); background: transparent; color: #c7d2fe;
    border-radius: .5rem; padding: .22rem .6rem; font-size: .8rem; font-weight: 600; white-space: nowrap;
}
.palette-undo:hover { background: rgba(99, 102, 241, .2); }
.palette-undo kbd { background: transparent; border: 1px solid rgba(148,163,184,.4); border-radius: 4px; padding: 0 .25rem; font-size: .68rem; color: #c7d2fe; }
.palette-toast-progress {
    position: absolute; left: 0; bottom: 0; height: 2px; background: var(--brand);
    animation: toastbar 8s linear forwards;
}
@keyframes toastbar { from { width: 100%; } to { width: 0; } }

/* Trigger-Feld (Tagesansicht) */
.palette-trigger {
    display: flex; align-items: center; gap: .7rem; width: 100%;
    border: 1px solid var(--line); border-radius: .8rem; background: #fff;
    padding: .7rem 1rem; color: var(--muted-2); cursor: text;
    transition: all .15s; text-align: left; font-size: .95rem;
}
.palette-trigger:hover { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(99, 102, 241, .12); }
.palette-trigger .palette-keys { margin-left: auto; }

/* ---------- Start/Stopp-Timer (Sidebar) ---------- */
.sidebar-timer {
    position: relative;
    margin: .5rem .85rem;
    border-radius: .9rem;
    padding: 1px; /* Platz für den Glow-Rand */
}
.sidebar-timer .timer-glow {
    position: absolute; inset: 0; border-radius: .9rem;
    background: conic-gradient(from var(--glow-angle, 0deg), #6366f1, #8b5cf6, #ec4899, #6366f1);
    animation: timerglow 4s linear infinite;
    opacity: .85;
}
@property --glow-angle { syntax: '<angle>'; initial-value: 0deg; inherits: false; }
@keyframes timerglow { to { --glow-angle: 360deg; } }
@supports not (background: conic-gradient(from var(--glow-angle, 0deg), red, blue)) {
    .sidebar-timer .timer-glow { background: linear-gradient(135deg, #6366f1, #8b5cf6); animation: none; }
}
.sidebar-timer .timer-body {
    position: relative;
    background: #1e293b;
    border-radius: calc(.9rem - 1px);
    padding: .6rem .75rem;
}
.timer-top { display: flex; align-items: center; gap: .5rem; }
.timer-dot {
    width: .55rem; height: .55rem; border-radius: 50%; background: #f87171; flex-shrink: 0;
    animation: timerpulse 1.6s ease-in-out infinite;
}
@keyframes timerpulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(248, 113, 113, .5); }
    50% { box-shadow: 0 0 0 5px rgba(248, 113, 113, 0); }
}
.timer-elapsed {
    color: #f8fafc; font-weight: 700; font-variant-numeric: tabular-nums;
    font-size: 1.02rem; letter-spacing: .01em;
}
.timer-actions { margin-left: auto; display: flex; gap: .25rem; }
.timer-btn {
    border: 0; background: rgba(148, 163, 184, .15); color: #cbd5e1;
    width: 1.7rem; height: 1.7rem; border-radius: .5rem; display: grid; place-items: center;
    font-size: .8rem; transition: all .15s;
}
.timer-btn:hover { background: rgba(148, 163, 184, .3); color: #fff; }
.timer-btn-stop { background: rgba(99, 102, 241, .35); color: #e0e7ff; }
.timer-btn-stop:hover { background: var(--brand); color: #fff; }
.timer-combo { display: flex; align-items: center; gap: .5rem; margin-top: .4rem; min-width: 0; }
.timer-label {
    color: #e2e8f0; font-size: .8rem; font-weight: 600; line-height: 1.25;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.timer-label small { display: block; color: #64748b; font-weight: 500; font-size: .7rem; }

/* Play-Button in Buchungszeilen */
.entry-row .timer-start { color: var(--success); }

@media (prefers-reduced-motion: reduce) {
    .palette-panel, .pchip, .pcard, .palette-toast { transition: none; animation: none; }
    .sidebar-timer .timer-glow, .timer-dot { animation: none; }
}
