/* ==========================================================================
   Zeiterfassung Bereuter TU
   ========================================================================== */

@font-face {
    font-family: "Plus Jakarta Sans";
    font-style: normal;
    font-weight: 200 800;
    font-display: swap;
    src: url("../fonts/plus-jakarta-sans-latin-wght.woff2") format("woff2");
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
    font-family: "Plus Jakarta Sans";
    font-style: normal;
    font-weight: 200 800;
    font-display: swap;
    src: url("../fonts/plus-jakarta-sans-latin-ext-wght.woff2") format("woff2");
    unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

:root {
    /* Marke (aus Logo) */
    --brand:        #004558;
    --brand-600:    #0a5a70;
    --brand-soft:   #e3eef2;
    --accent:       #6795ac;
    --grey:         #878787;

    /* Flächen & Text */
    --ink:          #0f2730;
    --ink-2:        #3c5560;
    --muted:        #7f8d93;
    --line:         #e4eaed;
    --line-2:       #eef2f4;
    --surface:      #ffffff;
    --surface-2:    #f5f8f9;
    --shell:        #f8fafb;

    --ok:           #2f8f63;
    --warn:         #c0743a;
    --danger:       #c2414b;

    --radius-xl:    32px;
    --radius-lg:    24px;
    --radius:       16px;
    --radius-sm:    12px;
    --shadow:       0 1px 2px rgba(15, 39, 48, .04), 0 8px 24px -12px rgba(15, 39, 48, .12);
    --shadow-pop:   0 12px 40px -8px rgba(15, 39, 48, .25);

    --font:         "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
    --ppm:          1.4px; /* Pixel pro Minute im Kalender */
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
    margin: 0;
    min-height: 100vh;
    font-family: var(--font);
    font-size: 14px;
    line-height: 1.45;
    color: var(--ink);
    background:
        radial-gradient(1200px 600px at 0% 0%, #f3d9c4 0%, transparent 60%),
        radial-gradient(1000px 700px at 100% 0%, #b7cfdb 0%, transparent 60%),
        linear-gradient(180deg, #dfe8ec 0%, #e9eef0 100%);
    background-attachment: fixed;
    -webkit-font-smoothing: antialiased;
}

h1, h2, h3 { margin: 0; font-weight: 600; letter-spacing: -.01em; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; }
[hidden] { display: none !important; }

.ico { width: 20px; height: 20px; flex-shrink: 0; }
.muted { color: var(--muted); }
.nowrap { white-space: nowrap; }
.spacer { flex: 1; }

/* ---------- Shell ---------- */

.app {
    display: grid;
    grid-template-columns: 96px minmax(0, 1fr);
    grid-template-rows: auto 1fr;
    margin: 20px;
    min-height: calc(100vh - 40px);
    background: var(--shell);
    border-radius: var(--radius-xl);
    box-shadow: 0 30px 80px -40px rgba(15, 39, 48, .35);
}

.topbar {
    grid-column: 1 / -1;
    position: sticky;
    top: 0;
    z-index: 40;
    display: flex;
    align-items: center;
    gap: 24px;
    padding: 26px 32px 10px 34px;
    border-radius: var(--radius-xl) var(--radius-xl) 0 0;
    background: var(--shell);
    transition: box-shadow .2s, padding .2s;
}
.topbar.is-stuck { padding-top: 14px; padding-bottom: 14px; border-radius: 0; box-shadow: 0 10px 24px -18px rgba(15, 39, 48, .45); }

.brand img { display: block; height: 22px; width: auto; }

.topbar-center { flex: 1; }
.app-label {
    display: inline-flex;
    padding: 6px 12px;
    border-radius: 999px;
    background: var(--brand-soft);
    color: var(--brand);
    font-size: 12px;
    font-weight: 600;
    letter-spacing: .02em;
}

.topbar-right { display: flex; align-items: center; gap: 12px; }

.search {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 300px;
    height: 46px;
    padding: 0 14px 0 16px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: var(--surface);
    color: var(--muted);
    transition: border-color .15s, box-shadow .15s;
}
.search:focus-within { border-color: var(--accent); box-shadow: 0 0 0 4px rgba(103, 149, 172, .15); }
.search input { flex: 1; min-width: 0; border: 0; outline: 0; background: none; font: inherit; color: var(--ink); }
.search input::placeholder { color: var(--muted); }
.search kbd {
    font: 600 11px var(--font);
    padding: 2px 7px;
    border: 1px solid var(--line);
    border-radius: 6px;
    color: var(--muted);
}
.search-inline { width: 320px; }

.user {
    position: relative;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 5px 12px 5px 5px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: var(--surface);
    cursor: pointer;
}
.avatar {
    display: grid;
    place-items: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent), var(--brand));
    color: #fff;
    font-size: 12px;
    font-weight: 700;
}
.user-meta { display: flex; flex-direction: column; line-height: 1.2; }
.user-meta strong { font-size: 13px; font-weight: 600; }
.user-meta small { font-size: 11px; color: var(--muted); }
.user-chev { width: 16px; height: 16px; color: var(--muted); }
.user-menu {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    min-width: 180px;
    padding: 6px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-pop);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-4px);
    transition: .15s;
    z-index: 50;
}
.user-menu-head { display: flex; flex-direction: column; gap: 2px; padding: 8px 10px 10px; margin-bottom: 4px; border-bottom: 1px solid var(--line-2); }
.user-menu-head strong { font-size: 13px; }
.user-menu-head small { font-size: 12px; color: var(--muted); }
.sso-note { display: inline-flex; align-items: center; gap: 6px; margin-top: 6px; font-size: 11px; font-weight: 600; color: var(--ok); }
.sso-note .ico { width: 14px; height: 14px; }
.user-menu { min-width: 240px; }

/* Laufende Stoppuhr in der Kopfzeile */
.timer-pill {
    display: flex;
    align-items: center;
    height: 46px;
    padding: 4px 4px 4px 16px;
    border-radius: 999px;
    background: var(--brand);
    color: #fff;
    box-shadow: 0 8px 20px -10px rgba(0, 69, 88, .7);
    animation: pop .2s ease-out;
}
.timer-pill-main { display: flex; align-items: center; gap: 10px; min-width: 0; padding-right: 12px; }
.timer-pill-name {
    max-width: 160px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 13px;
    font-weight: 500;
    color: rgba(255, 255, 255, .8);
}
.timer-pill-name::before {
    content: "";
    display: inline-block;
    width: 8px;
    height: 8px;
    margin-right: 8px;
    border-radius: 50%;
    background: var(--p, #fff);
    animation: pulse-dot 1.8s infinite;
}
@keyframes pulse-dot {
    0%   { box-shadow: 0 0 0 0 rgba(255, 255, 255, .55); }
    70%  { box-shadow: 0 0 0 7px rgba(255, 255, 255, 0); }
    100% { box-shadow: 0 0 0 0 rgba(255, 255, 255, 0); }
}
.timer-pill-time { font-size: 16px; font-weight: 600; font-variant-numeric: tabular-nums; letter-spacing: -.01em; }
.timer-pill-stop {
    display: grid;
    place-items: center;
    width: 38px;
    height: 38px;
    border: 0;
    border-radius: 50%;
    background: #fff;
    color: var(--brand);
    cursor: pointer;
    transition: transform .15s;
}
.timer-pill-stop:hover { transform: scale(1.08); }
.timer-pill-stop .ico { width: 16px; height: 16px; }

.user:focus-within .user-menu, .user.is-open .user-menu { opacity: 1; visibility: visible; transform: none; }

/* Sidebar */
.sidebar {
    position: relative;
    z-index: 30; /* Tooltips über den Karten im Hauptbereich */
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    padding: 30px 0 28px;
}
.side-link {
    position: relative;
    display: grid;
    place-items: center;
    width: 54px;
    height: 54px;
    border-radius: 50%;
    background: var(--surface);
    color: var(--ink-2);
    box-shadow: 0 1px 2px rgba(15, 39, 48, .05);
    transition: background .15s, color .15s, transform .15s;
}
.side-link:hover { color: var(--brand); transform: translateY(-1px); }
.side-link.is-active { background: var(--brand); color: #fff; box-shadow: 0 8px 20px -8px rgba(0, 69, 88, .6); }
.side-link .ico { width: 22px; height: 22px; }
.side-label { display: none; }
.side-spacer { flex: 1; }
.side-link::after {
    content: attr(data-tip);
    position: absolute;
    left: calc(100% + 12px);
    top: 50%;
    transform: translate(-4px, -50%);
    padding: 6px 10px;
    border-radius: 8px;
    background: var(--ink);
    color: #fff;
    font-size: 12px;
    font-weight: 500;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: .15s;
    z-index: 60;
}
.side-link:hover::after { opacity: 1; transform: translate(0, -50%); }

.main { min-width: 0; padding: 18px 32px 40px 12px; }

.page-head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 24px;
    margin: 6px 0 28px;
}
.page-subtitle { margin: 0 0 4px; font-size: 18px; color: var(--ink-2); font-weight: 400; }
.page-title { font-size: 48px; line-height: 1.05; font-weight: 600; letter-spacing: -.03em; }
.page-actions { display: flex; gap: 10px; }

/* ---------- Buttons, Pills, Chips ---------- */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    height: 44px;
    padding: 0 18px;
    border: 1px solid transparent;
    border-radius: var(--radius-sm);
    background: none;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    white-space: nowrap;
    transition: background .15s, border-color .15s, color .15s, box-shadow .15s;
}
.btn .ico { width: 18px; height: 18px; }
.btn-pill { border-radius: 999px; }
.btn-sm { height: 36px; padding: 0 14px; font-size: 13px; }
.btn-primary { background: var(--brand); color: #fff; }
.btn-primary:hover { background: var(--brand-600); box-shadow: 0 8px 20px -10px rgba(0, 69, 88, .7); }
.btn-outline { border-color: var(--line); background: var(--surface); }
.btn-outline:hover { border-color: var(--accent); color: var(--brand); }
.btn-ghost:hover { background: var(--surface-2); }
.btn-danger { color: var(--danger); }
.btn-danger:hover { background: #fbeced; }
.is-disabled { opacity: .4; pointer-events: none; }

.icon-btn {
    display: inline-grid;
    place-items: center;
    width: 44px;
    height: 44px;
    flex-shrink: 0;
    border: 1px solid var(--line);
    border-radius: 50%;
    background: var(--surface);
    cursor: pointer;
    transition: border-color .15s, color .15s, background .15s;
}
.icon-btn:hover { border-color: var(--accent); color: var(--brand); }
.icon-btn-sm { width: 32px; height: 32px; border-color: transparent; background: transparent; }
.icon-btn-sm .ico { width: 18px; height: 18px; }

.pills { display: flex; gap: 6px; flex-wrap: wrap; }
.pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    height: 44px;
    padding: 0 20px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: var(--surface);
    font-weight: 500;
    cursor: pointer;
    transition: .15s;
}
.pill:hover { border-color: var(--accent); }
.pill.is-active { background: var(--ink); border-color: var(--ink); color: #fff; }
.pill-count {
    min-width: 22px;
    padding: 1px 7px;
    border-radius: 999px;
    background: var(--surface-2);
    color: var(--ink-2);
    font-size: 11px;
    font-weight: 600;
    text-align: center;
}
.pill.is-active .pill-count { background: rgba(255, 255, 255, .16); color: #fff; }
.pills-sm .pill { height: 32px; padding: 0 14px; font-size: 12px; }

.chip {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    height: 30px;
    padding: 0 12px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: var(--surface);
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    white-space: nowrap;
    transition: .15s;
}
.chip:hover { border-color: var(--accent); color: var(--brand); }

.dot {
    display: inline-block;
    width: 10px;
    height: 10px;
    flex-shrink: 0;
    border-radius: 50%;
    background: var(--p, var(--grey));
}

.tag {
    display: inline-flex;
    padding: 3px 9px;
    border-radius: 999px;
    background: var(--surface-2);
    color: var(--muted);
    font-size: 11px;
    font-weight: 600;
}

/* ---------- Cards ---------- */

.card {
    position: relative;
    background: var(--surface);
    border-radius: var(--radius-lg);
    padding: 26px;
    box-shadow: var(--shadow);
}
.card-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 18px;
}
.card-head h2 { font-size: 22px; font-weight: 500; letter-spacing: -.02em; }

.progress { height: 6px; border-radius: 999px; background: var(--line-2); overflow: hidden; }
.progress span { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--accent), var(--brand)); }
.progress-lg { height: 10px; }

/* KPI */
.kpis { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.kpis-5 { grid-template-columns: repeat(5, 1fr); margin-bottom: 20px; }
.kpi { display: flex; flex-direction: column; gap: 10px; padding: 22px 24px; }
.kpi-label { font-size: 13px; color: var(--muted); font-weight: 500; }
.kpi-value { font-size: 32px; font-weight: 600; letter-spacing: -.03em; line-height: 1; font-variant-numeric: tabular-nums; }
.kpi-hint { font-size: 12px; color: var(--muted); }
.kpi-badge {
    position: absolute;
    top: 20px;
    right: 20px;
    padding: 3px 9px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}
.kpi-badge { background: var(--surface-2); color: var(--ink-2); }
.kpi-badge.is-plus { background: #e5f4ec; color: var(--ok); }
.kpi-badge.is-minus { background: #f8ece2; color: var(--warn); }

/* ---------- Dashboard ---------- */

.dash-grid {
    display: grid;
    grid-template-columns: repeat(12, minmax(0, 1fr));
    gap: 20px;
}
.card-timer { grid-column: span 7; }
.dash-grid > .kpis { grid-column: span 5; grid-template-columns: 1fr; gap: 14px; }
.dash-grid .kpi { padding: 18px 22px; gap: 8px; }
.dash-grid .kpi-value { font-size: 28px; }
.card-today, .card-donut, .card-week { grid-column: span 4; }

/* Timer */
.card-timer {
    display: flex;
    flex-direction: column;
    gap: 22px;
    color: #fff;
    background:
        radial-gradient(500px 260px at 100% 0%, rgba(103, 149, 172, .45), transparent 70%),
        linear-gradient(160deg, #0b5268 0%, var(--brand) 55%, #023341 100%);
    overflow: hidden;
}
.card-timer .card-head { margin: 0; }
.card-timer .card-head h2 { font-weight: 500; }
.timer-state {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    border-radius: 999px;
    background: rgba(255, 255, 255, .1);
    font-size: 12px;
    font-weight: 500;
}
.pulse { width: 8px; height: 8px; border-radius: 50%; background: #7fe0b0; box-shadow: 0 0 0 0 rgba(127, 224, 176, .7); }
.card-timer.is-running .pulse { animation: pulse 1.8s infinite; }
.card-timer:not(.is-running) .pulse { background: rgba(255, 255, 255, .4); }
@keyframes pulse {
    0%   { box-shadow: 0 0 0 0 rgba(127, 224, 176, .6); }
    70%  { box-shadow: 0 0 0 10px rgba(127, 224, 176, 0); }
    100% { box-shadow: 0 0 0 0 rgba(127, 224, 176, 0); }
}
.timer-display {
    font-size: clamp(56px, 6vw, 84px);
    font-weight: 300;
    letter-spacing: -.04em;
    line-height: 1;
    font-variant-numeric: tabular-nums;
}
.timer-fields { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr) auto; gap: 10px; align-items: center; }
.timer-btn {
    display: grid;
    place-items: center;
    width: 56px;
    height: 56px;
    border: 0;
    border-radius: 50%;
    background: #fff;
    color: var(--brand);
    cursor: pointer;
    transition: transform .15s, box-shadow .15s;
}
.timer-btn:hover { transform: scale(1.05); box-shadow: 0 8px 24px -8px rgba(0, 0, 0, .5); }
.timer-btn .ico { width: 22px; height: 22px; }
.card-timer.is-running .i-play, .card-timer:not(.is-running) .i-stop { display: none; }
.card-timer:not(.is-running) .timer-btn { background: #7fe0b0; color: #053b2a; }

.input-dark {
    height: 48px;
    border-color: rgba(255, 255, 255, .14) !important;
    background: rgba(255, 255, 255, .08) !important;
    color: #fff !important;
}
.input-dark::placeholder { color: rgba(255, 255, 255, .5); }

.quickstart { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: auto; }
.quickstart-label { width: 100%; font-size: 12px; color: rgba(255, 255, 255, .6); font-weight: 500; }
.chip-dark { background: rgba(255, 255, 255, .08); border-color: rgba(255, 255, 255, .12); color: #fff; }
.chip-dark:hover { background: rgba(255, 255, 255, .16); border-color: rgba(255, 255, 255, .3); color: #fff; }

/* Heute-Liste */
.card-today { display: flex; flex-direction: column; }
.today-sum {
    display: flex;
    align-items: center;
    gap: 12px;
    height: 52px;
    padding: 0 18px 0 8px;
    margin-bottom: 14px;
    border: 1px solid var(--line);
    border-radius: 999px;
    font-weight: 500;
}
.badge-count {
    display: grid;
    place-items: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--ink);
    color: #fff;
    font-size: 13px;
    font-weight: 600;
}
.entry-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 520px;
    overflow-y: auto;
    scrollbar-width: thin;
}
.entry-item {
    display: flex;
    gap: 14px;
    padding: 14px 16px;
    border-radius: var(--radius);
    background: color-mix(in srgb, var(--p) 9%, #fff);
    border-left: 3px solid var(--p);
    cursor: pointer;
    transition: background .15s;
}
.entry-item:hover { background: color-mix(in srgb, var(--p) 15%, #fff); }
.entry-time {
    display: flex;
    flex-direction: column;
    min-width: 50px;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}
.entry-time span { font-size: 11px; font-weight: 500; color: var(--muted); }
.entry-body { display: flex; flex-direction: column; min-width: 0; }
.entry-body strong { font-weight: 600; }
.entry-body span { color: var(--ink-2); font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.entry-item.is-running {
    cursor: default;
    background: repeating-linear-gradient(-45deg, color-mix(in srgb, var(--p) 10%, #fff) 0 8px, color-mix(in srgb, var(--p) 16%, #fff) 8px 16px);
}
.entry-item.is-running .entry-time span { color: var(--ok); }

/* Charts */
.chart { min-height: 260px; }
.legend { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 8px; }
.legend li { display: flex; align-items: center; gap: 10px; font-size: 13px; }
.legend li span:nth-child(2) { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.legend li strong { font-variant-numeric: tabular-nums; font-weight: 600; }
.apexcharts-tooltip.apexcharts-theme-light {
    border: 1px solid var(--line) !important;
    border-radius: 12px !important;
    box-shadow: var(--shadow-pop) !important;
    font-family: var(--font) !important;
}
.apexcharts-tooltip-title { background: var(--surface-2) !important; border-bottom-color: var(--line) !important; font-weight: 600; }
.chart-tip { padding: 8px 12px; font-size: 12px; }
.chart-tip strong { display: block; font-size: 13px; }

/* ---------- Formulare ---------- */

.input {
    width: 100%;
    height: 46px;
    padding: 0 14px;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    background: var(--surface);
    font: inherit;
    color: var(--ink);
    outline: 0;
    transition: border-color .15s, box-shadow .15s;
}
textarea.input { height: auto; padding: 12px 14px; resize: vertical; min-height: 70px; }
.input:focus { border-color: var(--accent); box-shadow: 0 0 0 4px rgba(103, 149, 172, .15); }
.input.is-invalid { border-color: var(--danger); }
.input-pill { border-radius: 999px; padding-right: 40px; appearance: none; cursor: pointer; font-weight: 500; }
input[type="time"].input { font-variant-numeric: tabular-nums; }

.select-wrap { position: relative; display: inline-block; min-width: 200px; }
.select-wrap .ico { position: absolute; right: 14px; top: 50%; width: 16px; height: 16px; transform: translateY(-50%); pointer-events: none; color: var(--muted); }

.field { display: flex; flex-direction: column; gap: 7px; }
.field-label { font-size: 12px; font-weight: 600; color: var(--ink-2); }
.field-label em { font-style: normal; font-weight: 500; color: var(--muted); }
.field-row { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 12px; }

.segmented {
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: 1fr;
    padding: 4px;
    border-radius: 999px;
    background: var(--surface-2);
}
.segmented input { position: absolute; opacity: 0; pointer-events: none; }
.segmented span {
    display: block;
    padding: 9px 12px;
    border-radius: 999px;
    text-align: center;
    font-weight: 500;
    color: var(--ink-2);
    cursor: pointer;
    transition: .15s;
}
.segmented input:checked + span { background: var(--surface); color: var(--ink); box-shadow: 0 1px 3px rgba(15, 39, 48, .12); font-weight: 600; }
.segmented input:focus-visible + span { outline: 2px solid var(--accent); }

.duration-bar {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    border-radius: var(--radius-sm);
    background: var(--brand-soft);
    color: var(--brand);
}
.duration-bar strong { font-size: 18px; font-variant-numeric: tabular-nums; }
.quick-durations { display: flex; gap: 6px; margin-left: auto; }
.quick-durations .chip { height: 28px; border-color: transparent; background: rgba(255, 255, 255, .7); color: var(--brand); }

.form-error { margin: 0; padding: 10px 14px; border-radius: var(--radius-sm); background: #fbeced; color: var(--danger); font-size: 13px; font-weight: 500; }

/* Combobox */
.combo { position: relative; }
.combo-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    height: 46px;
    padding: 0 14px;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    background: var(--surface);
    text-align: left;
    cursor: pointer;
}
.combo-btn .dot { background: var(--grey); }
.combo-btn .ico { width: 16px; height: 16px; margin-left: auto; color: var(--muted); }
.combo-label { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 500; }
.combo-label.is-placeholder { color: var(--muted); font-weight: 400; }
.combo.is-open .combo-btn, .combo-btn:focus-visible { border-color: var(--accent); box-shadow: 0 0 0 4px rgba(103, 149, 172, .15); outline: 0; }
.combo.is-invalid .combo-btn { border-color: var(--danger); }
.combo-dark .combo-btn { height: 48px; border-color: rgba(255, 255, 255, .14); background: rgba(255, 255, 255, .08); color: #fff; }
.combo-dark .combo-btn .ico { color: rgba(255, 255, 255, .6); }
.combo-dark.is-open .combo-btn { border-color: rgba(255, 255, 255, .4); box-shadow: none; }
.combo-pop {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    min-width: 100%;
    width: max-content;
    max-width: 340px;
    padding: 6px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow-pop);
    color: var(--ink);
    z-index: 120;
    display: none;
}
.combo.is-open .combo-pop { display: block; }
.combo-search {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 0 10px;
    margin-bottom: 4px;
    border-bottom: 1px solid var(--line-2);
    color: var(--muted);
}
.combo-search .ico { width: 16px; height: 16px; }
.combo-search input { flex: 1; height: 40px; border: 0; outline: 0; font: inherit; background: none; color: var(--ink); }
.combo-list { max-height: 280px; overflow-y: auto; scrollbar-width: thin; }
.combo-group { padding: 10px 10px 4px; font-size: 11px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
.combo-opt {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 8px 10px;
    border: 0;
    border-radius: 8px;
    background: none;
    text-align: left;
    cursor: pointer;
}
.combo-opt:hover, .combo-opt.is-focus { background: var(--surface-2); }
.combo-opt.is-selected { font-weight: 600; }
.combo-opt.is-selected::after { content: "✓"; margin-left: auto; color: var(--brand); }
.combo-empty { padding: 14px 10px; color: var(--muted); font-size: 13px; }

/* Switch */
.switch-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 14px 16px;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    cursor: pointer;
}
.switch-row span { display: flex; flex-direction: column; }
.switch-row small { color: var(--muted); font-size: 12px; }
.switch {
    appearance: none;
    position: relative;
    width: 44px;
    height: 26px;
    flex-shrink: 0;
    margin: 0;
    border-radius: 999px;
    background: var(--line);
    cursor: pointer;
    transition: background .15s;
}
.switch::after {
    content: "";
    position: absolute;
    top: 3px;
    left: 3px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 1px 3px rgba(0, 0, 0, .2);
    transition: transform .15s;
}
.switch:checked { background: var(--brand); }
.switch:checked::after { transform: translateX(18px); }

/* ---------- Modal ---------- */

.modal { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; padding: 20px; }
.modal-backdrop { position: absolute; inset: 0; background: rgba(15, 39, 48, .35); backdrop-filter: blur(4px); animation: fade .15s; }
.modal-card {
    position: relative;
    width: min(560px, 100%);
    max-height: calc(100vh - 40px);
    display: flex;
    flex-direction: column;
    background: var(--surface);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-pop);
    animation: pop .18s ease-out;
}
.modal-sm { width: min(480px, 100%); }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 22px 24px 6px; }
.modal-head h2 { font-size: 22px; font-weight: 600; }
.modal-head .icon-btn { width: 38px; height: 38px; border-color: transparent; }
.modal-body { display: flex; flex-direction: column; gap: 16px; padding: 16px 24px; overflow-y: auto; }
.modal-foot { display: flex; align-items: center; gap: 8px; padding: 14px 24px 22px; }
/* Rückfrage (ZE.confirm), auch über einem offenen Modal */
.modal-confirm { z-index: 110; }
.modal-confirm .modal-card { width: min(420px, 100%); }
.modal-confirm .modal-head h2 { font-size: 19px; line-height: 1.35; }
.modal-confirm .modal-body { padding-top: 6px; }
.confirm-text { margin: 0; color: var(--muted); line-height: 1.55; }
.btn-primary.is-danger { background: var(--danger); border-color: var(--danger); }
.btn-primary.is-danger:hover { background: color-mix(in srgb, var(--danger) 88%, #000); }
@keyframes fade { from { opacity: 0; } }
@keyframes pop { from { opacity: 0; transform: translateY(8px) scale(.98); } }

/* ---------- Toast ---------- */

.toasts { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%); z-index: 200; display: flex; flex-direction: column; gap: 8px; align-items: center; }
.toast {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 18px;
    border-radius: 999px;
    background: var(--ink);
    color: #fff;
    font-weight: 500;
    box-shadow: var(--shadow-pop);
    animation: pop .2s ease-out;
}
.toast .ico { width: 18px; height: 18px; color: #7fe0b0; }
.toast small { color: rgba(255, 255, 255, .6); font-weight: 400; }
.toast.is-error { background: var(--danger); }
.toast.is-error .ico { color: #fff; }

/* ---------- Menüs ---------- */

.menu-item {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 9px 10px;
    border: 0;
    border-radius: 8px;
    background: none;
    font-size: 13px;
    font-weight: 500;
    text-align: left;
    cursor: pointer;
}
.menu-item .ico { width: 17px; height: 17px; color: var(--muted); }
.menu-item:hover { background: var(--surface-2); }

/* ---------- Toolbar ---------- */

.toolbar, .cal-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
    margin-bottom: 20px;
}
.cal-nav { display: flex; align-items: center; gap: 8px; }
.cal-range { margin-left: 10px; font-size: 20px; font-weight: 600; letter-spacing: -.02em; }
.cal-range span { margin-left: 6px; font-size: 13px; font-weight: 500; color: var(--muted); }

/* ---------- Kalender ---------- */

.cal-layout { display: grid; grid-template-columns: minmax(0, 1fr) 290px; gap: 20px; align-items: start; }
.cal-card { padding: 0; overflow: hidden; }

.cal { --cols: 7; }
.cal[data-view="day"] { --cols: 1; }
.cal-head, .cal-body { display: grid; grid-template-columns: 64px repeat(var(--cols), minmax(0, 1fr)); }
.cal-head { border-bottom: 1px solid var(--line); background: var(--surface); position: relative; z-index: 3; }
.cal-day-head {
    display: grid;
    grid-template-columns: auto 1fr;
    grid-template-rows: auto auto;
    column-gap: 10px;
    align-items: center;
    padding: 14px 12px 12px;
    border: 0;
    border-left: 1px solid var(--line-2);
    background: none;
    text-align: left;
    cursor: pointer;
}
.cal-day-head:hover { background: var(--surface-2); }
.cal-dnum {
    grid-row: span 2;
    display: grid;
    place-items: center;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    font-size: 18px;
    font-weight: 600;
}
.cal-dow { grid-column: 2; font-size: 12px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
.cal-dsum { grid-column: 2; font-size: 13px; font-weight: 600; font-variant-numeric: tabular-nums; }
.cal-dnum { grid-column: 1; grid-row: 1 / 3; }
.cal-day-head.is-today .cal-dnum { background: var(--brand); color: #fff; }
.cal-day-head.is-today .cal-dow { color: var(--brand); }

.cal-scroll { max-height: calc(100vh - 330px); min-height: 420px; overflow-y: auto; scrollbar-width: thin; }
.cal-body { position: relative; height: calc(var(--hours) * 60 * var(--ppm) + 16px); padding-top: 8px; }
.cal-times { position: relative; }
.cal-times span {
    display: block;
    height: calc(60 * var(--ppm));
    padding-right: 10px;
    transform: translateY(-.6em);
    text-align: right;
    font-size: 11px;
    font-weight: 500;
    color: var(--muted);
    font-variant-numeric: tabular-nums;
}
.cal-col {
    position: relative;
    border-left: 1px solid var(--line-2);
    background-image:
        linear-gradient(var(--line-2) 1px, transparent 1px),
        linear-gradient(to bottom, transparent calc(30 * var(--ppm) - 1px), #f4f7f8 calc(30 * var(--ppm) - 1px), #f4f7f8 calc(30 * var(--ppm)), transparent calc(30 * var(--ppm)));
    background-size: 100% calc(60 * var(--ppm));
    cursor: crosshair;
    user-select: none;
}
.cal-col.is-today { background-color: rgba(103, 149, 172, .045); }
.cal-col { container-type: inline-size; }
@container (max-width: 190px) {
    .cal-block.is-compact .cal-block-time { display: none; }
}
.cal-col.is-weekend { background-color: rgba(15, 39, 48, .025); }
.cal-day-head.is-weekend .cal-dow, .cal-day-head.is-weekend .cal-dnum { color: var(--muted); }
.cal-day-head .cal-dow { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cal-holiday { color: var(--warn); text-transform: none; letter-spacing: 0; }

.cal[data-view="day"] .cal-day-head:not(.is-selected),
.cal[data-view="day"] .cal-col:not(.is-selected) { display: none; }

.cal-block {
    position: absolute;
    left: 4px;
    right: 4px;
    top: calc(var(--s) * var(--ppm));
    height: calc(var(--d) * var(--ppm) - 2px);
    min-height: 12px;
    display: flex;
    flex-direction: column;
    gap: 1px;
    padding: 6px 9px;
    border-radius: 10px;
    border-left: 3px solid var(--p);
    background: color-mix(in srgb, var(--p) 14%, #fff);
    color: color-mix(in srgb, var(--p) 55%, #0f2730);
    font-size: 12px;
    line-height: 1.3;
    overflow: hidden;
    cursor: pointer;
    z-index: 1;
    transition: box-shadow .15s, transform .15s;
}
.cal-block:hover, .cal-block:focus-visible { z-index: 2; box-shadow: 0 6px 18px -6px color-mix(in srgb, var(--p) 60%, transparent); outline: 0; }
.cal-block strong { font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cal-block-desc { color: var(--ink-2); overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.cal-block-time { margin-top: auto; font-size: 11px; color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.cal-block.is-compact { flex-direction: row; align-items: center; gap: 6px; padding-top: 0; padding-bottom: 0; }
.cal-block.is-compact .cal-block-desc { display: none; }
.cal-block.is-compact .cal-block-time { margin: 0 0 0 auto; }
.cal-block.is-short { flex-direction: row; flex-wrap: wrap; align-content: flex-start; column-gap: 6px; padding-top: 4px; padding-bottom: 4px; }
.cal-block.is-short strong { flex: 1 1 0; min-width: 0; }
.cal-block.is-short .cal-block-time { margin: 0; }
.cal-block.is-short .cal-block-desc { flex-basis: 100%; -webkit-line-clamp: 1; }
.cal-block.is-tiny { min-height: 8px; font-size: 10.5px; border-radius: 6px; }
.cal-block.is-tiny .cal-block-time { display: none; }
.cal-block.is-absence {
    border-left-color: var(--grey);
    background: repeating-linear-gradient(-45deg, #f3f4f5 0 6px, #eceeef 6px 12px);
    color: var(--ink-2);
}
.cal-block.is-running {
    border-left-style: dashed;
    background: repeating-linear-gradient(-45deg, color-mix(in srgb, var(--p) 12%, #fff) 0 7px, color-mix(in srgb, var(--p) 20%, #fff) 7px 14px);
    cursor: default;
}
.cal-block.is-ghost {
    background: color-mix(in srgb, var(--brand) 12%, #fff);
    border: 1px dashed var(--brand);
    border-left-width: 3px;
    color: var(--brand);
    pointer-events: none;
    z-index: 3;
}
.cal[data-view="day"] .cal-block { right: 30%; }

.cal-now {
    position: absolute;
    left: 0;
    right: 0;
    top: calc(var(--s) * var(--ppm));
    height: 2px;
    background: var(--danger);
    z-index: 4;
    pointer-events: none;
}
.cal-now::before { content: ""; position: absolute; left: -5px; top: -4px; width: 10px; height: 10px; border-radius: 50%; background: var(--danger); }
.cal-now span {
    position: absolute;
    right: 4px;
    top: -9px;
    padding: 1px 6px;
    border-radius: 6px;
    background: var(--danger);
    color: #fff;
    font-size: 10px;
    font-weight: 600;
}

/* Kalender-Seitenleiste */
.cal-side { position: sticky; top: 20px; }
.week-total { display: flex; align-items: baseline; gap: 10px; margin-bottom: 12px; }
.week-total strong { font-size: 36px; font-weight: 600; letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.week-total span { color: var(--muted); }
.side-title { margin: 26px 0 12px; font-size: 13px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
.bar-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 12px; max-height: 360px; overflow-y: auto; scrollbar-width: thin; }
.bar-list-row { display: flex; align-items: center; gap: 10px; font-size: 13px; }
.bar-list-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 500; }
.bar-list-val { font-weight: 600; font-variant-numeric: tabular-nums; }
.bar-list-bar { height: 4px; margin: 6px 0 0 20px; border-radius: 999px; background: var(--line-2); }
.bar-list-bar span { display: block; height: 100%; border-radius: inherit; background: var(--p); }
.bar-list .empty { color: var(--muted); }
.side-hint {
    display: flex;
    gap: 10px;
    margin: 24px 0 0;
    padding: 14px;
    border-radius: var(--radius-sm);
    background: var(--surface-2);
    color: var(--ink-2);
    font-size: 12px;
}
.side-hint .ico { width: 18px; height: 18px; color: var(--accent); }

/* ---------- Projekte ---------- */

.project-groups { display: flex; flex-direction: column; gap: 32px; }
.group-title { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; font-size: 18px; font-weight: 600; }
.group-title span { padding: 1px 9px; border-radius: 999px; background: var(--surface); color: var(--muted); font-size: 12px; }
.project-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 16px; }
.project-card {
    display: flex;
    flex-direction: column;
    gap: 14px;
    padding: 20px;
    background: linear-gradient(180deg, color-mix(in srgb, var(--p) 10%, #fff) 0%, #fff 70%);
    transition: transform .15s, box-shadow .15s;
}
.project-card:hover { transform: translateY(-2px); box-shadow: 0 14px 30px -16px color-mix(in srgb, var(--p) 70%, transparent); }
.project-card.is-archived { background: var(--surface); opacity: .7; }
.project-tags { position: absolute; top: 22px; right: 54px; display: flex; gap: 4px; }
.project-card-head { display: flex; align-items: center; justify-content: space-between; }
.project-swatch {
    width: 38px;
    height: 38px;
    border-radius: 12px;
    background: var(--p);
    box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .06), 0 6px 14px -8px var(--p);
}
.project-name { font-size: 17px; font-weight: 700; letter-spacing: -.01em; }
.project-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; padding-top: 12px; border-top: 1px solid var(--line-2); }
.project-stats span { display: block; font-size: 11px; color: var(--muted); }
.project-stats strong { font-size: 14px; font-weight: 600; font-variant-numeric: tabular-nums; }

.project-menu { position: relative; }
.project-menu .menu {
    position: absolute;
    right: 0;
    top: calc(100% + 4px);
    min-width: 180px;
    padding: 6px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-pop);
    z-index: 20;
    display: none;
}
.project-menu.is-open .menu { display: block; }

.swatches { display: flex; flex-wrap: wrap; gap: 8px; }
.swatch { position: relative; cursor: pointer; }
.swatch input { position: absolute; opacity: 0; pointer-events: none; }
.swatch span {
    display: grid;
    place-items: center;
    width: 32px;
    height: 32px;
    border-radius: 10px;
    background: var(--c);
    color: #fff;
    transition: transform .12s, box-shadow .12s;
}
.swatch span .ico { width: 16px; height: 16px; opacity: 0; }
.swatch:hover span { transform: scale(1.08); }
.swatch input:checked + span { box-shadow: 0 0 0 2px #fff, 0 0 0 4px var(--c); }
.swatch input:checked + span .ico { opacity: 1; }
.swatch-custom span { background: conic-gradient(#e2725b, #e0a030, #6a9f3a, #2f9fb5, #5b6ee1, #c45fa0, #e2725b); }
.swatch-custom span .ico { opacity: 1; filter: drop-shadow(0 1px 1px rgba(0, 0, 0, .4)); }
.swatch-custom input[type="color"] { inset: 0; width: 100%; height: 100%; cursor: pointer; pointer-events: auto; }
.swatch-custom.is-checked span { box-shadow: 0 0 0 2px #fff, 0 0 0 4px var(--c, var(--accent)); }

.project-preview {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 14px;
    border-radius: var(--radius-sm);
    background: color-mix(in srgb, var(--p, var(--brand)) 10%, #fff);
    border-left: 3px solid var(--p, var(--brand));
    font-weight: 600;
}
.project-preview .dot { background: var(--p, var(--brand)); }

.empty-state { margin: 0; padding: 40px 20px; text-align: center; color: var(--muted); }

/* ---------- Berichte ---------- */

.report-charts { display: grid; grid-template-columns: 1.4fr 1fr; gap: 20px; margin-bottom: 20px; }
.report-table-card .card-head h2 { font-size: 20px; }

.table { width: 100%; border-collapse: collapse; }
.table th {
    padding: 0 14px 12px;
    font-size: 11px;
    font-weight: 600;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: .06em;
    text-align: left;
    border-bottom: 1px solid var(--line);
}
.table td { padding: 14px; border-bottom: 1px solid var(--line-2); vertical-align: middle; }
.table .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.table tfoot td { border-bottom: 0; border-top: 1px solid var(--line); font-weight: 700; padding-top: 16px; }

.report-row { cursor: pointer; transition: background .12s; }
.report-row:hover { background: var(--surface-2); }
.row-name { display: inline-flex; align-items: center; gap: 10px; }
.row-chev { width: 16px; height: 16px; color: var(--muted); transition: transform .15s; }
.report-row.is-open .row-chev { transform: rotate(180deg); }
.report-row.is-open { background: var(--surface-2); }
.share-col { width: 22%; }
.share-col small { display: inline-block; width: 46px; text-align: right; font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.share { display: inline-block; width: calc(100% - 54px); height: 6px; border-radius: 999px; background: var(--line-2); vertical-align: middle; }
.share span { display: block; height: 100%; border-radius: inherit; background: var(--p); }

.report-detail > td { padding: 0 14px 14px 34px; background: var(--surface-2); }
.table-inner td { padding: 9px 12px; font-size: 13px; border-bottom: 1px solid var(--line); }
.table-inner tr:last-child td { border-bottom: 0; }
.table-inner { background: var(--surface); border-radius: var(--radius-sm); overflow: hidden; }

/* ---------- Einstellungen & Profil ---------- */
.show-sm { display: none; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

.settings-tabs { margin-bottom: 20px; }
.settings-tabs .pill .ico { width: 18px; height: 18px; }
.toolbar-note { margin: 0; font-size: 13px; color: var(--muted); }

.table-card { padding: 18px 12px 8px; }
.table-scroll { overflow-x: auto; }
.table tbody tr:last-child td { border-bottom: 0; }
.table tr.is-past td, .table tr.is-inactive td { color: var(--muted); }
.table tr.is-inactive .avatar { background: var(--line); color: var(--muted); }
.table-compact th { padding: 0 10px 10px; }
.table-compact td { padding: 10px; }

.person-cell { display: flex; align-items: center; gap: 12px; min-width: 220px; }
.person-meta { display: flex; flex-direction: column; min-width: 0; }
.person-meta strong { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; font-weight: 600; }
.person-meta small { color: var(--muted); font-size: 12px; }
.avatar-sm { width: 34px; height: 34px; flex-shrink: 0; font-size: 11px; }
.avatar-lg { width: 64px; height: 64px; flex-shrink: 0; font-size: 20px; }

.tag { align-items: center; gap: 4px; white-space: nowrap; }
.tag .ico { width: 12px; height: 12px; }
.tag-brand { background: var(--brand-soft); color: var(--brand); }
.tag-warn { background: #f8ece2; color: var(--warn); }

.row-actions { display: flex; justify-content: flex-end; gap: 2px; }
.row-actions .icon-btn-sm { color: var(--ink-2); }
.row-actions .btn-danger { color: var(--danger); }

.year-nav { display: flex; align-items: center; gap: 10px; }
.year-nav strong { min-width: 52px; text-align: center; font-size: 20px; font-weight: 600; font-variant-numeric: tabular-nums; }
.year-nav-sm strong { min-width: 40px; font-size: 15px; }
.inline-form { margin: 0; }

.settings-card { max-width: 640px; }
.settings-form { display: flex; flex-direction: column; gap: 22px; }
.settings-form .card-head { margin: 0; }
.settings-foot { display: flex; justify-content: flex-end; }
.input-short { max-width: 160px; }
.field-hint { font-size: 12px; color: var(--muted); line-height: 1.5; }
.field-static { margin: 0; font-weight: 600; }
.field-row-2 { grid-template-columns: 1fr 1fr; }

.modal-sub { margin: 4px 0 0; font-size: 13px; color: var(--muted); }
.model-history { display: flex; flex-direction: column; gap: 6px; }
.model-history:empty { display: none; }
.model-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 8px 10px 14px;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
}
.model-row.is-current { border-color: var(--accent); background: var(--brand-soft); }
.model-row.is-past { color: var(--muted); }
.model-row-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.model-row-text strong { display: flex; align-items: center; gap: 6px; font-size: 13px; }
.model-row-text small { font-size: 12px; color: var(--ink-2); }
.model-row.is-past small { color: var(--muted); }
.model-empty { margin: 0; padding: 12px 14px; border-radius: var(--radius-sm); background: var(--surface-2); color: var(--ink-2); font-size: 13px; }

.day-picker { display: flex; gap: 6px; flex-wrap: wrap; }
.day-chip { position: relative; }
.day-chip input { position: absolute; opacity: 0; pointer-events: none; }
.day-chip span {
    display: grid;
    place-items: center;
    width: 44px;
    height: 38px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: var(--surface);
    font-size: 13px;
    font-weight: 600;
    color: var(--muted);
    cursor: pointer;
    transition: .15s;
}
.day-chip input:checked + span, .day-chip.is-on span { background: var(--brand); border-color: var(--brand); color: #fff; }
.day-chip input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }
.day-picker.is-static .day-chip span { cursor: default; }

.profile-grid { display: grid; grid-template-columns: repeat(12, 1fr); gap: 20px; align-items: start; }
.profile-side, .profile-main { display: flex; flex-direction: column; gap: 20px; min-width: 0; }
.profile-side { grid-column: span 4; }
.profile-main { grid-column: span 8; }
.profile-model { display: flex; flex-direction: column; gap: 20px; }
.profile-model .card-head { margin: 0; }
.profile-model .side-title { margin: 4px 0 0; }
.profile-soll .table tr.is-current td { background: var(--brand-soft); color: var(--brand); font-weight: 600; }
.profile-soll .table tr.is-current td:first-child { border-radius: 10px 0 0 10px; }
.profile-soll .table tr.is-current td:last-child { border-radius: 0 10px 10px 0; }
.profile-id { display: flex; align-items: center; gap: 16px; margin-bottom: 22px; }
.profile-id h2 { font-size: 20px; }
.def-list { display: grid; grid-template-columns: auto 1fr; gap: 10px 16px; margin: 0; font-size: 13px; }
.def-list dt { color: var(--muted); font-weight: 500; }
.def-list dd { margin: 0; font-weight: 600; overflow-wrap: anywhere; }
.notice { display: flex; gap: 10px; margin: 0; padding: 14px; border-radius: var(--radius-sm); background: #f8ece2; color: var(--warn); font-size: 13px; }
.model-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.model-stats div { display: flex; flex-direction: column; gap: 6px; padding: 16px; border-radius: var(--radius); background: var(--surface-2); }
.model-stats span { font-size: 12px; color: var(--muted); font-weight: 500; }
.model-stats strong { font-size: 24px; font-weight: 600; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }

.holiday-list { list-style: none; margin: 0 0 16px; padding: 0; display: flex; flex-direction: column; }
.holiday-list li { display: grid; grid-template-columns: 112px 1fr auto; align-items: center; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--line-2); font-size: 13px; }
.holiday-list li:last-child { border-bottom: 0; }
.holiday-list li.is-past { color: var(--muted); }
.holiday-list li.is-next .holiday-name { color: var(--brand); font-weight: 600; }
.holiday-date { font-variant-numeric: tabular-nums; color: var(--ink-2); }
.holiday-list li.is-past .holiday-date { color: var(--muted); }
.holiday-name small { color: var(--muted); }

/* ---------- Berichte: Verrechnung & Monatsblatt ---------- */
.print-only { display: none; }
.is-plus { color: var(--ok); }
.is-minus { color: var(--warn); }

.report-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 20px; }
.report-head .settings-tabs { margin: 0; }
.toolbar-group { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.toolbar-group .select-wrap { min-width: 170px; }

.billing-card { padding: 18px 12px 12px; }
.billing-table tbody + tbody .billing-group td { padding-top: 22px; }
.billing-group td { padding: 12px 14px 8px; border-bottom: 1px solid var(--line); font-size: 12px; font-weight: 700; color: var(--brand); text-transform: uppercase; letter-spacing: .05em; }
.billing-table .report-row td:first-child { padding-left: 26px; }
.table-note { margin: 14px 14px 4px; font-size: 12px; color: var(--muted); }

/* Monatsblatt im Layout des HR-Formulars (Excel «Arbeitszeit»): Arial, Grössen in pt wie im Original */
.sheet { padding: 24px 22px 18px; font-family: Arial, Helvetica, sans-serif; color: #000; }
.sheet-head { display: grid; grid-template-columns: 1fr auto 1fr; align-items: start; margin-bottom: 9pt; }
/* Masse wie auf dem gedruckten HR-Formular (Logo 87 mm, Titel 50 mm breit); der Druck skaliert ca. 0.96 */
.sheet-logo { width: 91mm; height: auto; }
.sheet-title { justify-self: center; margin-top: 2mm; font: 700 30pt/1 Arial, Helvetica, sans-serif; letter-spacing: 0; -webkit-text-stroke: .5pt currentColor; }
.sheet-meta { justify-self: end; display: grid; grid-template-columns: auto auto; column-gap: 14mm; margin: 0; font-size: 10pt; line-height: 12.75pt; }
.sheet-meta dt { font-weight: 400; }
.sheet-meta dd { margin: 0; text-align: right; }

.sheet-table { width: 100%; min-width: 1000px; table-layout: fixed; border-collapse: collapse; border: 1px solid #000; font-variant-numeric: tabular-nums; }
.sheet-table .col-code { width: 12mm; }
.sheet-table .col-name { width: 37mm; }
.sheet-table .col-total { width: 12mm; }
.sheet-table .col-hours { width: 15mm; }
.sheet-table th, .sheet-table td { height: 18pt; padding: 0 1px; border: 0.5px solid #a6a6a6; text-align: center; vertical-align: middle; white-space: nowrap; overflow: hidden; }
.sheet-table thead th { height: 24.75pt; border-top: 1px solid #000; border-bottom: 0.5px solid #a6a6a6; font-size: 10pt; font-weight: 400; background: none; }
.sheet-table .sheet-code { font-size: 9pt; }
.sheet-table thead .sheet-code { padding: 0 2px; white-space: normal; line-height: 1.05; }
.sheet-table .sheet-name { padding: 0 3pt; text-align: left; font-size: 9pt; text-overflow: ellipsis; }
.sheet-table td.sheet-day { font-size: 7pt; }
.sheet-table .sheet-total { border-left: 2px solid #000; border-right: 2px solid #000; font-size: 9pt; }
.sheet-table thead .sheet-total { border-top: 2px solid #000; font-size: 10pt; font-weight: 700; }
.sheet-table .sheet-hours { font-size: 8pt; color: #6b6b6b; border-left: 0; }
.sheet-table .is-off { background: #d9d9d9; }
.sheet-table .is-void { background: #f2f2f2; }
.sheet-table tfoot td { height: 21.75pt; border-top: 2px solid #000; border-bottom: 2px solid #000; font-size: 8pt; }
.sheet-table tfoot .sheet-daytotal-label { padding-left: 3pt; border-left: 2px solid #000; border-right: 2px solid #000; text-align: left; font-size: 11pt; }
.sheet-table tfoot .sheet-total { font-size: 9pt; }

.sheet-summary { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 32px; margin-top: 18px; font-family: var(--font); color: var(--ink); }
.sheet-summary dl { display: grid; grid-template-columns: 1fr auto; gap: 6px 16px; margin: 0; padding: 14px 16px; border-radius: var(--radius-sm); background: var(--surface-2); font-size: 13px; }
.sheet-summary dt { color: var(--ink-2); }
.sheet-summary dd { margin: 0; font-weight: 700; text-align: right; font-variant-numeric: tabular-nums; }
.sheet-sign { margin-top: 10pt; font-size: 10pt; }
.sheet-sign-date { display: flex; align-items: flex-end; gap: 6pt; width: 52mm; }
.sheet-sign-row { display: grid; grid-template-columns: auto minmax(0, 1fr) auto minmax(0, 1fr); align-items: end; column-gap: 6pt; margin-top: 15pt; }
.sheet-sign-row span:nth-child(3) { margin-left: 12mm; }
.sheet-line { flex: 1; height: 12.75pt; border-bottom: 0.5px solid #000; }
.sheet-footer { margin-top: 12pt; text-align: center; font-size: 8.5pt; letter-spacing: .13em; text-transform: uppercase; color: #1d3a49; white-space: nowrap; }

.model-stats strong.is-plus { color: var(--ok); }
.model-stats strong.is-minus { color: var(--warn); }

/* ---------- Monatsabschluss, Freigaben, Rechnungen ---------- */
.select-block { display: block; width: 100%; }
.select-block .input { width: 100%; appearance: none; padding-right: 40px; }
.link { color: var(--brand); font-weight: 600; }
.link:hover { text-decoration: underline; }
.side-link { position: relative; }
.side-badge {
    position: absolute;
    top: 4px;
    right: 4px;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    border-radius: 999px;
    background: var(--warn);
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    line-height: 18px;
    text-align: center;
}

.tag-status.is-submitted { background: #f8ece2; color: var(--warn); }
.tag-status.is-approved { background: #e5f4ec; color: var(--ok); }
.tag-status.is-returned { background: #fbeced; color: var(--danger); }

.submit-bar { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-bottom: 20px; padding: 18px 22px; border-left: 4px solid var(--accent); }
.submit-bar.is-submitted { border-left-color: var(--warn); }
.submit-bar.is-approved { border-left-color: var(--ok); }
.submit-bar.is-returned { border-left-color: var(--danger); }
.submit-bar-text { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.submit-bar-text strong { display: flex; align-items: center; gap: 8px; font-size: 15px; }
.submit-bar-text span { color: var(--ink-2); font-size: 13px; }
.submit-bar blockquote { margin: 6px 0 0; padding: 8px 12px; border-radius: 8px; background: #fbeced; color: var(--danger); font-size: 13px; }
.sheet-approved { display: flex; align-items: center; gap: 6px; margin-bottom: 4px; color: var(--ok); font-size: 12px; }
.sheet-approved .ico { width: 14px; height: 14px; }

.approval { display: flex; flex-direction: column; gap: 18px; margin-bottom: 20px; }
.approval-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.approval-head h2 { font-size: 20px; font-weight: 600; }
.approval .side-title { margin: 0; }
.approval-table td { vertical-align: top; }
.approval-foot { display: flex; align-items: center; gap: 8px; padding-top: 4px; border-top: 1px solid var(--line-2); }
.segmented-sm span { padding: 6px 12px; font-size: 12px; }
.input-hours { max-width: 96px; text-align: right; font-variant-numeric: tabular-nums; }
.input.is-disabled { background: var(--surface-2); color: var(--muted); }
.check-col { width: 36px; }
.check-col input { width: 16px; height: 16px; accent-color: var(--brand); }
.billing-company { margin-bottom: 20px; }
.billing-company .approval-head { margin-bottom: 8px; }

.invoice-layout { display: grid; grid-template-columns: minmax(300px, 380px) minmax(0, 1fr); gap: 20px; align-items: start; }
.invoice-layout > .invoice-doc:only-child { grid-column: 1 / -1; justify-self: center; }
.invoice-editor { display: flex; flex-direction: column; gap: 14px; position: sticky; top: 100px; }
.invoice-editor .card-head { margin: 0; }
.invoice-line-edit { display: flex; gap: 8px; }
.invoice-line-edit .input:first-child { flex: 1; min-width: 0; }
.invoice-editor-foot { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding-top: 6px; }

.invoice-doc {
    display: flex;
    flex-direction: column;
    width: 100%;
    max-width: 794px;
    min-height: 1123px;
    padding: 64px 72px 32px;
    background: #fff;
    box-shadow: var(--shadow);
    color: #1d2327;
    font-size: 13px;
    line-height: 1.5;
}
.invoice-top { display: flex; flex-direction: column-reverse; }
.invoice-logo { align-self: flex-end; width: 230px; }
.invoice-recipient { margin-top: 64px; font-size: 14px; line-height: 1.7; }
.invoice-date { margin: 56px 0 0; text-align: right; }
.invoice-titlebar { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; margin-top: 22px; }
.invoice-titlebar h1 { font-size: 15px; font-weight: 700; letter-spacing: .03em; text-transform: uppercase; }
.invoice-titlebar dl { display: grid; grid-template-columns: auto auto; gap: 2px 6px; margin: 0; font-size: 13px; }
.invoice-titlebar dt { text-align: right; }
.invoice-titlebar dd { margin: 0; }
.invoice-titlebar dl dt:nth-of-type(2), .invoice-titlebar dl dd:nth-of-type(2) { font-size: 10px; }
.invoice-kind { margin: 40px 0 0; font-weight: 700; font-variant: small-caps; font-size: 14px; letter-spacing: .02em; }
.invoice-period { margin: 34px 0 0; }
.invoice-period span:first-child { display: inline-block; min-width: 180px; }
.invoice-table { width: 100%; margin-top: 24px; border-collapse: collapse; }
.invoice-table th { padding: 4px 6px; border-bottom: 1px solid #1d2327; font-weight: 400; text-align: left; }
.invoice-table td { padding: 5px 6px; }
.invoice-table .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.invoice-table .cur { width: 46px; padding-left: 18px; }
.invoice-table .invoice-objects td { padding: 30px 6px 22px; }
.invoice-subtotal td { padding-top: 12px; padding-bottom: 14px; }
.invoice-subtotal td:nth-child(n+2) { border-top: 1px solid #1d2327; }
.invoice-total td { padding-top: 10px; font-weight: 700; }
.invoice-total td:nth-child(n+2) { border-top: 1px solid #1d2327; border-bottom: 3px double #1d2327; }
.invoice-terms { margin: 90px 0 0; }
.invoice-terms span { display: inline-block; min-width: 150px; }
.invoice-footer { margin-top: auto; padding-top: 40px; font-size: 8px; letter-spacing: .06em; text-transform: uppercase; color: #3c4a50; }

/* ---------- Druck (Monatsblatt, Verrechnung, Berichte) ---------- */
@media print {
    @page { size: A4 landscape; margin: 10mm; }
    body { background: #fff; font-size: 11px; }
    .topbar, .sidebar, .page-head, .no-print, .toasts, .timer-pill, .modal, .row-chev, .side-hint { display: none !important; }
    .print-only { display: block; }
    .app { display: block; margin: 0; padding: 0; background: none; box-shadow: none; border-radius: 0; min-height: 0; }
    .main { padding: 0; }
    .card { box-shadow: none; border-radius: 0; padding: 0; background: none; }
    .table-scroll { overflow: visible; }
    .billing-table .report-detail { display: table-row !important; }
    .billing-table .table-inner td { padding: 3px 8px; font-size: 10px; }
    .print-head { display: flex; align-items: center; gap: 20px; margin-bottom: 14px; }
    .print-head img { height: 20px; }
    .print-head div { display: flex; flex-direction: column; gap: 2px; }
    .print-head span { color: var(--muted); }
    .kpis, .report-charts { break-inside: avoid; }
    .sheet { display: flex; flex-direction: column; width: 297mm; height: 209mm; padding: 8mm 6.5mm 6mm; overflow: hidden; }
    .sheet .table-scroll { overflow: visible; }
    .sheet-table { min-width: 0; }
    .sheet-table .is-off, .sheet-table .is-void { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
    .sheet-footer { margin-top: auto; }
    .invoice-layout { display: block; }
    .invoice-doc { width: 210mm; max-width: none; min-height: 297mm; padding: 18mm 20mm 10mm; box-shadow: none; font-size: 11pt; }
    .invoice-footer { font-size: 6pt; letter-spacing: .02em; white-space: nowrap; }
}

/* ---------- Responsive ---------- */

@media screen and (max-width: 1200px) {
    .profile-side, .profile-main { grid-column: span 12; }
    .profile-main { order: -1; }
    .invoice-layout { grid-template-columns: 1fr; }
    .invoice-editor { position: static; }
    .search { width: 220px; }
    .card-timer, .dash-grid > .kpis, .card-today { grid-column: span 12; }
    .dash-grid > .kpis { grid-template-columns: repeat(3, 1fr); }
    .card-donut, .card-week { grid-column: span 6; }
    .cal-layout { grid-template-columns: 1fr; }
    .cal-side { position: static; }
    .report-charts { grid-template-columns: 1fr; }
    .kpis-5 { grid-template-columns: repeat(3, 1fr); }
}

@media screen and (max-width: 860px) {
    .show-sm { display: inline; }
    .submit-bar { flex-direction: column; align-items: stretch; }
    .invoice-doc { padding: 28px 20px; min-height: 0; font-size: 12px; }
    .invoice-titlebar { flex-direction: column; align-items: flex-start; }
    .side-badge { top: 0; right: 0; }
    .report-head .person-picker, .report-head .select-wrap { width: 100%; }
    .sheet-head { grid-template-columns: 1fr; gap: 10px; }
    .sheet-title, .sheet-meta { justify-self: start; }
    .sheet-summary { grid-template-columns: 1fr; }
    .sheet-sign-row { grid-template-columns: auto 1fr; row-gap: 15pt; }
    .sheet-sign-row span:nth-child(3) { margin-left: 0; }
    .sheet-footer { white-space: normal; }
    .person-cell { min-width: 0; }
    .people-table .person-meta small { display: none; }
    .people-table .tag-warn { white-space: normal; }
    .day-picker { flex-wrap: nowrap; }
    .day-chip { flex: 1; min-width: 0; }
    .day-chip span { width: auto; }
    .model-stats { grid-template-columns: 1fr 1fr; }
    .model-stats strong { font-size: 20px; }
    .settings-tabs { flex-wrap: nowrap; overflow-x: auto; }
    .settings-tabs .pill { flex-shrink: 0; }
    .field-row.field-row-2 { grid-template-columns: 1fr; }
    .holiday-list li { grid-template-columns: 1fr auto; }
    .holiday-date { grid-column: 1 / -1; font-size: 12px; }
    .app { margin: 0; border-radius: 0; grid-template-columns: 1fr; min-height: 100vh; }
    .topbar { position: static; padding: 16px; gap: 12px; flex-wrap: wrap; border-radius: 0; }
    .topbar-center, .user-meta, .user-chev, .search kbd { display: none; }
    .brand { flex: 1; }
    .brand img { height: 18px; }
    .topbar-right { width: 100%; }
    .search { flex: 1; width: auto; }
    .topbar-right .btn span { display: none; }
    .topbar-right .btn { width: 46px; padding: 0; }
    .timer-pill { position: fixed; left: 16px; right: 16px; bottom: 80px; z-index: 89; justify-content: space-between; }
    .timer-pill-name { max-width: 50vw; }
    .sidebar {
        position: fixed;
        left: 50%;
        bottom: 12px;
        transform: translateX(-50%);
        flex-direction: row;
        padding: 6px;
        gap: 4px;
        border-radius: 999px;
        background: rgba(255, 255, 255, .9);
        backdrop-filter: blur(10px);
        box-shadow: var(--shadow-pop);
        z-index: 90;
    }
    .side-spacer, .side-link::after { display: none; }
    .side-link { width: 48px; height: 48px; box-shadow: none; }
    .main { padding: 8px 16px 100px; }
    .page-head { flex-direction: column; align-items: flex-start; margin-bottom: 20px; }
    .page-title { font-size: 34px; }
    .page-subtitle { font-size: 15px; }
    .card { padding: 20px; border-radius: 20px; }
    .kpis-5, .dash-grid > .kpis { grid-template-columns: 1fr 1fr; }
    .card-donut, .card-week { grid-column: span 12; }
    .timer-fields { grid-template-columns: 1fr auto; }
    .timer-fields .combo { grid-column: 1 / -1; }
    .search-inline, .select-wrap { width: 100%; }
    .field-row { grid-template-columns: 1fr 1fr; }
    .field-row .field:first-child { grid-column: 1 / -1; }
    .duration-bar { flex-wrap: wrap; }
    .quick-durations { margin-left: 0; }
    .cal { --cols: 1; }
    .cal .cal-col:not(.is-selected) { display: none; }
    [data-cal-view] { display: none; }
    .cal-head { grid-template-columns: repeat(7, 1fr); }
    .cal-head .cal-gutter { display: none; }
    .cal .cal-day-head, .cal[data-view="day"] .cal-day-head:not(.is-selected) {
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 2px;
        padding: 10px 2px;
    }
    .cal-day-head.is-selected { background: var(--surface-2); box-shadow: inset 0 -2px 0 var(--brand); }
    .cal-dnum { width: 34px; height: 34px; font-size: 15px; }
    .cal-dsum { font-size: 11px; }
    .cal-body { grid-template-columns: 52px minmax(0, 1fr); }
    .cal[data-view] .cal-block { right: 4px; }
    .kpi-badge { position: static; align-self: flex-start; order: 5; }
    .cal-scroll { max-height: 65vh; min-height: 0; }
    .cal-range { font-size: 16px; margin-left: 4px; }
    .table .hide-sm, .report-table th:nth-child(2), .report-table td:nth-child(2),
    .report-table th:nth-child(5), .report-table td:nth-child(5) { display: none; }
    .share-col { width: 30%; }
}
