﻿.dt-shell {
    width: 100%;
    max-width: 500px;
    padding: 12px;
    box-sizing: border-box;
}

.dt-header {
    /*position: sticky;*/
    top: 0;
    z-index: 5;
    background: var(--mud-palette-background);
    padding-bottom: 10px;
}

.dt-title {
    font-weight: 600;
}

.dt-zoom {
    min-width: 130px;
}

.dt-running {
    padding: 10px;
    border-radius: 12px;
}

.dt-duration {
    font-variant-numeric: tabular-nums;
}

.dt-legend {
    flex-wrap: wrap;
}

.dt-chip-work {
    border-color: var(--mud-palette-primary);
    background: rgba(var(--mud-palette-primary-rgb), 0.16);
    border: 1px solid rgba(var(--mud-palette-primary-rgb), 0.45);
}

.dt-chip-appt {
    background: rgba(2, 136, 209, 0.10); /* info-ish */
    border-color: rgba(2, 136, 209, 0.20);
}

.dt-chip-timer {
    background: rgba(46, 125, 50, 0.10); /* success-ish */
    border-color: rgba(46, 125, 50, 0.20);
}
.dt-chip-break {
    background: rgba(211,47,47,0.10);
    border-color: rgba(211,47,47,0.35);
}
.dt-chip-holiday {
    background: rgba(123, 31, 162, 0.10); /* secondary-ish */
    border-color: rgba(123, 31, 162, 0.20);
}

/* Scroll area */
.dt-viewport {
    height: 100vh; /* passt meist gut in Sidebar; ggf. anpassen */
    overflow: auto;
    padding-right: 4px;
}

/* Main layout: ruler + lanes */
.dt-grid {
    position: relative;
    display: grid;
    grid-template-columns: 56px 1fr;
    gap: 10px;
    padding-top: 10px;
    /* total height: total minutes * px/min */
    min-height: calc(var(--dt-total-min) * var(--dt-px-per-min) * 1px);
}

/* Ruler */
.dt-ruler {
    position: relative;
}

.dt-hour-label {
    position: absolute;
    left: 0;
    transform: translateY(-50%);
    font-size: 12px;
    color: var(--mud-palette-text-secondary);
}

/* Lanes container */
.dt-lanes {
    position: relative;
    border-radius: 14px;
    background: rgba(0,0,0,0.02);
    overflow: hidden;
}

/* Two lanes side-by-side */
.dt-lane {
    position: absolute;
    top: 0; /* statt 28px */
    bottom: 0;
    width: 50%;
    padding: 6px;
    box-sizing: border-box;
}

.dt-lane-work {
    left: 0;
    border-right: 1px solid rgba(0,0,0,0.08);
}

.dt-lane-appt {
    right: 0;
}

.dt-lane-header {
    position: absolute;
    top: 0;
    height: 28px;
    display: flex;
    align-items: center;
    padding: 0 10px;
    box-sizing: border-box;
    width: 50%;
    background: rgba(0,0,0,0.03);
}

.dt-lane-header-work {
    left: 0;
}

.dt-lane-header-appt {
    right: 0;
}

/* Hour lines across lanes */
.dt-hour-line {
    position: absolute;
    left: 0;
    right: 0;
    height: 1px;
    background: rgba(0,0,0,0.06);
}

/* Now indicator */
.dt-now {
    position: absolute;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--mud-palette-error);
    opacity: 0.65;
    z-index: 4;
}

.dt-now-dot {
    position: absolute;
    left: 6px;
    top: -4px;
    width: 10px;
    height: 10px;
    border-radius: 99px;
    background: var(--mud-palette-error);
}

.dt-now-label {
    position: absolute;
    left: 22px;
    top: -10px;
    font-size: 11px;
    color: var(--mud-palette-error);
    background: var(--mud-palette-background);
    padding: 0 6px;
    border-radius: 99px;
}

/* Items */
.dt-item {
    position: absolute;
    left: 6px;
    right: 6px;
    border-radius: 12px;
    padding: 8px;
    box-sizing: border-box;
    cursor: pointer;
    overflow: hidden;
    box-shadow: 0 1px 0 rgba(0,0,0,0.06);
    border: 1px solid rgba(0,0,0,0.07);
}

.dt-item-title {
    font-size: 12.5px;
    font-weight: 600;
    line-height: 1.15;
}

.dt-item-sub {
    font-size: 11px;
    color: var(--mud-palette-text-secondary);
    margin-top: 2px;
}

.dt-item-time {
    margin-top: 6px;
    font-size: 11px;
    color: var(--mud-palette-text-secondary);
    font-variant-numeric: tabular-nums;
}

/* Types */
.dt-item-work {
    background: rgba(var(--mud-palette-primary-rgb), 0.16);
    border: 1px solid rgba(var(--mud-palette-primary-rgb), 0.45);
}

.dt-item-appt {
    background: rgba(2, 136, 209, 0.10); /* info-ish */
    border-color: rgba(2, 136, 209, 0.20);
}

/*.dt-item-break {
    background: rgba(245, 124, 0, 0.10);*/ /* warning-ish */
    /*border-color: rgba(245, 124, 0, 0.20);
}*/

/* Simple overlap columns within a lane: split width */
.dt-col-0 {
    right: 6px;
    left: 6px;
}

.dt-col-1 {
    right: 6px;
    left: 40%;
}

.dt-col-2 {
    right: 6px;
    left: 60%;
}

.dt-item-timer {
    background: rgba(46, 125, 50, 0.10); /* success-ish */
    border-color: rgba(46, 125, 50, 0.20);
}

.dt-item-holiday {
    background: rgba(123, 31, 162, 0.10); /* secondary-ish */
    border-color: rgba(123, 31, 162, 0.20);
}

.dt-item-time-badge {
    position: absolute;
    top: 6px;
    right: 8px;
    font-size: 10px;
    padding: 2px 6px;
    border-radius: 999px;
    background: rgba(255,255,255,0.75);
    color: var(--mud-palette-text-secondary);
    font-variant-numeric: tabular-nums;
    backdrop-filter: blur(3px);
}

.dt-item.compact {
    padding: 4px 8px;
}

.dt-item.tiny {
    padding: 0;
    border-radius: 999px;
}

.dt-item-anchor {
    position: relative;
    width: 100%;
    height: 100%;
}

.dt-item {
    box-sizing: border-box;
    z-index: 2;
}

    .dt-item:hover {
        z-index: 5; /* hover über andere Items */
    }

.dt-item-break {
    background: rgba(211,47,47,0.10);
    border-color: rgba(211,47,47,0.35);
    border-style: dashed;
}

    .dt-item-break .dt-item-title {
        color: rgba(211,47,47,0.95);
    }

    .dt-item-break .dt-item-time-badge {
        color: rgba(211,47,47,0.85);
    }


.dt-lane-headers {
    position: sticky;
    top: 0;
    z-index: 5;
    display: grid;
    grid-template-columns: 1fr 1fr;
    background: var(--mud-palette-background, #fff);
    border-bottom: 1px solid rgba(0,0,0,.06);
}

.dt-lanes-body {
    position: relative;
}

.dt-item--narrow {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

    .dt-item--narrow .dt-item-time-badge {
        position: static !important; /* wichtig, wenn vorher absolute */
        align-self: flex-end; /* rechts oben */
        margin: 0;
    }

    .dt-item--narrow .dt-item-title {
        margin-top: 0;
    }