/**
 * Dienstplan Feature Styles
 *
 * All styles for the Dienstplan components.
 * Uses dp- prefix to avoid conflicts with other styles.
 *
 * @see /dienstplan/specifications.md - Feature requirements
 */

/* ==================== MATERIAL ICONS - LOCAL FONT ==================== */

@font-face {
    font-family: "Material Icons";
    font-style: normal;
    font-weight: 400;
    src: url("/src/fonts/MaterialIcons-Regular.woff2") format("woff2");
}

.dp-material-icons {
    font-family: 'Material Icons';
    font-weight: normal;
    font-style: normal;
    font-size: 24px;
    line-height: 1;
    letter-spacing: normal;
    text-transform: none;
    display: inline-block;
    white-space: nowrap;
    word-wrap: normal;
    direction: ltr;
    -webkit-font-feature-settings: 'liga';
    font-feature-settings: 'liga';
    -webkit-font-smoothing: antialiased;
}

/* ==================== DRAG STATE - DISABLE TEXT SELECTION ==================== */

body.dp-dragging {
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    cursor: grabbing !important;
}

body.dp-dragging * {
    cursor: grabbing !important;
}

/* ==================== APP CONTAINER ==================== */

.dp-app {
    display: flex;
    flex-direction: column;
    min-height: 500px;
    background: var(--pc-bg-primary, #fff);
    overflow: hidden;
}

/* ==================== CONTENT WRAPPER ==================== */

.dp-content-wrapper {
    display: flex;
    flex-direction: column;
    background: var(--pc-bg-primary, #fff);
    border-radius: 8px;
    margin-bottom: 88px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

/* ==================== TOOLBAR ==================== */

.dp-toolbar {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px 20px;
    background: var(--pc-bg-secondary, #f8f9fa);
    border-bottom: 1px solid var(--pc-border-color, #e0e0e0);
    flex-shrink: 0;
}

.dp-toolbar pc-knob-multi-select {
    min-width: 200px;
}

/* ==================== HEADER (Month Navigation) ==================== */

.dp-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.dp-header-nav {
    display: flex;
    align-items: center;
    gap: 8px;
}

.dp-nav-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border: 1px solid var(--pc-border-color, #e0e0e0);
    border-radius: 6px;
    background: white;
    color: var(--rd-font-dark, #232629);
    cursor: pointer;
    transition: all 0.2s;
}

.dp-nav-btn:hover {
    background: var(--pc-hover-bg, #f0f0f0);
    border-color: var(--pc-primary-color, #1976d2);
}

.dp-header-selects {
    display: flex;
    gap: 8px;
}

.dp-month-select,
.dp-year-select {
    padding: 8px 12px;
    border: 1px solid var(--pc-border-color, #e0e0e0);
    border-radius: 6px;
    background: white;
    color: var(--rd-font-dark, #232629);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
}

.dp-month-select {
    min-width: 120px;
}

.dp-today-btn {
    padding: 8px 16px;
    border: 1px solid var(--pc-border-color, #e0e0e0);
    border-radius: 6px;
    background: white;
    color: var(--rd-font-dark, #232629);
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s;
}

.dp-today-btn:hover {
    background: var(--pc-primary-color, #1976d2);
    color: white;
    border-color: var(--pc-primary-color, #1976d2);
}

.dp-header-actions {
    display: flex;
    gap: 8px;
}

.dp-action-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border: 1px solid var(--pc-border-color, #e0e0e0);
    border-radius: 6px;
    background: white;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s;
}

.dp-action-btn:hover {
    background: var(--pc-hover-bg, #f0f0f0);
}

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

/* ==================== GRID ==================== */

/* Custom element needs flex properties for proper layout */
pc-dienstplan-grid {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
    overflow: hidden;
}

.dp-grid {
    display: flex;
    flex-direction: column;
    flex: 1;
    overflow: hidden;
}

.dp-grid-header {
    display: flex;
    background: var(--pc-bg-secondary, #f8f9fa);
    border-bottom: 2px solid var(--pc-border-color, #e0e0e0);
    flex-shrink: 0;
}

.dp-header-employee {
    position: sticky;
    left: 0;
    min-width: 180px;
    max-width: 180px;
    padding: 12px 16px;
    font-weight: 600;
    background: var(--pc-bg-secondary, #f8f9fa);
    border-right: 2px solid var(--pc-border-color, #e0e0e0);
    z-index: 2;
}

.dp-header-days {
    display: flex;
    flex: 1;
    overflow-x: auto;
}

.dp-header-day {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-width: 48px;
    padding: 8px 4px;
    border-right: 1px solid var(--pc-border-color, #e0e0e0);
    flex: 1;
}

.dp-header-day--weekend {
    background: rgba(0, 0, 0, 0.03);
}

.dp-header-day--today {
    background: rgba(25, 118, 210, 0.1);
}

.dp-header-daynum {
    font-weight: 600;
    font-size: 14px;
}

.dp-header-dayname {
    font-size: 11px;
    color: var(--pc-text-secondary, #666);
    text-transform: uppercase;
}

.dp-header-summary {
    position: sticky;
    right: 0;
    min-width: 100px;
    max-width: 100px;
    padding: 12px 8px;
    font-weight: 600;
    text-align: center;
    background: var(--pc-bg-secondary, #f8f9fa);
    border-left: 2px solid var(--pc-border-color, #e0e0e0);
    z-index: 2;
}

/* ==================== GRID BODY ==================== */

.dp-grid-body {
    flex: 1;
    overflow-x: scroll;
    overflow-y: visible
}

/* ==================== ROW ==================== */

pc-dienstplan-row {
    display: flex;
}

.dp-row {
    display: flex;
    flex: 1;
    align-items: stretch;
    border-bottom: 1px solid var(--pc-border-color, #e0e0e0);
}

.dp-row:hover {
    background: rgba(0, 0, 0, 0.01);
}

.dp-employee-name {
    position: sticky;
    left: 0;
    min-width: 180px;
    max-width: 180px;
    min-height: 48px;
    padding: 8px 16px;
    background: white;
    border-right: 2px solid var(--pc-border-color, #e0e0e0);
    z-index: 10;
    display: flex;
    align-items: center;
}

.dp-employee-text {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 14px;
}

.dp-row-cells {
    display: flex;
    flex: 1;
    align-items: stretch;
}

.dp-row-summary {
    position: sticky;
    right: 0;
    min-width: 100px;
    max-width: 100px;
    min-height: 48px;
    padding: 8px;
    text-align: center;
    background: white;
    border-left: 2px solid var(--pc-border-color, #e0e0e0);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
}

.dp-summary-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    font-size: 12px;
}

.dp-summary-hours {
    font-weight: 600;
}

.dp-summary-ist {
    color: var(--pc-text-secondary, #666);
    font-size: 11px;
}

.dp-summary-empty {
    color: var(--pc-text-secondary, #999);
}

/* ==================== CELL ==================== */

pc-dienstplan-cell {
    flex: 1;
}

.dp-cell {
    position: relative;
    min-width: 48px;
    min-height: 48px;
    height: 100%;
    display: flex;
    align-items: stretch;
    justify-content: center;
    border-right: 1px solid var(--pc-border-color, #e0e0e0);
    cursor: pointer;
    transition: background-color 0.15s;
}

.dp-cell:hover {
    background-color: var(--pc-hover-bg, rgba(0, 0, 0, 0.05)) !important;
}

.dp-cell--weekend {
    background-color: rgba(0, 0, 0, 0.02);
}

.dp-cell--today {
    background: rgba(25, 118, 210, 0.1);
}

.dp-cell--filled {
    border-left-width: 3px;
}

.dp-cell-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
}

.dp-cell-shortcode {
    font-weight: 700;
    font-size: 14px;
}

.dp-cell-time {
    font-size: 9px;
    opacity: 0.8;
}

.dp-cell-empty {
    width: 100%;
    height: 100%;
    min-height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ==================== MULTIPLE SHIFTS PER DAY ==================== */

.dp-cell--multiple {
    /* Multiple shifts - adjust cell height */
}

.dp-cell-shifts {
    display: flex;
    flex-direction: column;
    gap: 2px;
    width: 100%;
    height: 100%;
    padding: 3px;
    overflow: visible;
    justify-content: flex-start;
}

.dp-shift-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    min-height: 36px;
    padding: 2px 4px;
    border-radius: 3px;
    border-left: 3px solid;
    cursor: pointer;
    transition: opacity 0.15s;
}

.dp-shift-item:hover {
    opacity: 0.8;
}

.dp-shift-item .dp-cell-shortcode {
    font-size: 11px;
    font-weight: 700;
    line-height: 1.2;
}

.dp-shift-item .dp-cell-time {
    font-size: 8px;
    opacity: 0.8;
    line-height: 1;
}

/* When only one shift, keep larger font */
.dp-cell-shifts:has(.dp-shift-item:only-child) .dp-cell-shortcode {
    font-size: 14px;
}

.dp-cell-shifts:has(.dp-shift-item:only-child) .dp-cell-time {
    font-size: 9px;
}

/* Continuation shift items */
.dp-shift-item--continuation {
    flex-direction: row;
    justify-content: center;
    cursor: pointer;
    border-left: none;
    margin-left: -4px;
    margin-right: -4px;
    border-radius: 0;
}

.dp-shift-item--continuation .dp-continuation-indicator {
    font-size: 12px;
    font-weight: 700;
    opacity: 0.6;
}

/* First day of continuation shift */
.dp-shift-item--first-day {
    margin-right: -4px;
}

/* Last day of continuation shift */
.dp-shift-item--last-day {
    border-right-width: 3px;
    border-right-style: solid;
    margin-right: 0;
    border-top-right-radius: 3px;
    border-bottom-right-radius: 3px;
}

/* Single-day shift (not continuation) */
.dp-shift-item--only-day {
    border-radius: 3px;
    border-left-width: 3px;
    border-right-width: 3px;
    border-left-style: solid;
    border-right-style: solid;
}

/* ==================== RESIZE HANDLES ==================== */

.dp-resize-handle {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 8px;
    cursor: ew-resize;
    z-index: 5;
    opacity: 0;
    transition: opacity 0.15s, background-color 0.15s;
}

.dp-resize-handle:hover {
    opacity: 1;
}

.dp-resize-handle--left {
    left: -2px;
    border-radius: 3px 0 0 3px;
}

.dp-resize-handle--right {
    right: -2px;
    border-radius: 0 3px 3px 0;
}

.dp-resize-handle::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 2px;
    height: 12px;
    background: currentColor;
    border-radius: 1px;
    opacity: 0.6;
}

.dp-shift-item:hover .dp-resize-handle {
    opacity: 0.7;
}

.dp-shift-item:hover .dp-resize-handle:hover {
    opacity: 1;
    background-color: rgba(0, 0, 0, 0.1);
}

/* Preview shift when extending into empty cells */
.dp-shift-item--preview {
    opacity: 0.6;
    border-style: dashed !important;
    pointer-events: none;
}

/* Shrinking shift - cells being removed from the shift */
.dp-shift-item--shrinking {
    opacity: 0.3;
    pointer-events: none;
}

/* Smooth transitions for resize feedback */
.dp-shift-item {
    position: relative;
    transition: opacity 0.1s ease-out;
}

/* Hide add button during resize */
.dp-cell-shifts:has(.dp-shift-item--preview) .dp-add-shift-area,
.dp-cell-shifts:has(.dp-shift-item--shrinking) .dp-add-shift-area {
    display: none;
}

/* Slot spacer - maintains alignment for multi-day shifts */
.dp-shift-spacer {
    flex: 0 0 auto;
    min-height: 36px;
    visibility: hidden;
}

/* Add shift area - clickable zone below existing shifts */
.dp-add-shift-area {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 36px;
    flex: 1 0 auto;
    border: 1px dashed var(--rd-border-secondary, #ddd);
    border-radius: 3px;
    cursor: pointer;
    opacity: 0.4;
    transition: opacity 0.15s, background-color 0.15s;
    margin-top: 2px;
}

.dp-add-shift-area:hover {
    opacity: 1;
    background-color: rgba(0, 0, 0, 0.05);
}

.dp-add-shift-icon {
    font-size: 12px;
    font-weight: 700;
    color: var(--rd-font-secondary, #666);
    line-height: 1;
}

/* Selector subtitle for add/edit mode */
.dp-selector-subtitle {
    font-size: 11px;
    font-weight: 400;
    opacity: 0.7;
    margin-left: 8px;
}

/* ==================== MULTI-DAY SHIFT CONTINUATION ==================== */

/* Start of a multi-day shift */
.dp-cell--start.dp-cell--filled {
    border-right: none;
    border-top-right-radius: 0;
    border-bottom-right-radius: 0;
}

/* Continuation cells (middle days) */
.dp-cell--continuation {
    border-left: none;
    border-radius: 0;
    cursor: default;
}

.dp-cell--continuation-middle {
    border-right: none;
}

/* Last day of multi-day shift */
.dp-cell--continuation-end {
    border-left: none;
    border-top-left-radius: 0;
    border-bottom-left-radius: 0;
}

.dp-cell-continuation-content {
    flex-direction: row;
    justify-content: center;
}

.dp-continuation-indicator {
    font-size: 14px;
    font-weight: 700;
    opacity: 0.6;
}

/* Visual connector between days */
.dp-cell--start.dp-cell--filled::after,
.dp-cell--continuation-middle::after {
    content: '';
    position: absolute;
    right: -1px;
    top: 20%;
    bottom: 20%;
    width: 2px;
    background: inherit;
    border-color: inherit;
}

/* ==================== CELL SELECTOR POPUP ==================== */

.dp-cell-selector {
    position: fixed;
    z-index: 1000;
    min-width: 200px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    border: 1px solid var(--pc-border-color, #e0e0e0);
    overflow: hidden;
}

.dp-selector-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 12px;
    background: var(--pc-bg-secondary, #f8f9fa);
    border-bottom: 1px solid var(--pc-border-color, #e0e0e0);
    font-weight: 500;
    font-size: 13px;
    color: var(--rd-font-dark, #232629);
}

.dp-selector-actions {
    display: flex;
    gap: 4px;
}

.dp-selector-edit,
.dp-selector-delete {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border: none;
    border-radius: 4px;
    background: transparent;
    cursor: pointer;
    transition: background 0.2s;
}

.dp-selector-edit {
    color: var(--pc-primary-color, #1976d2);
}

.dp-selector-edit:hover {
    background: rgba(25, 118, 210, 0.1);
}

.dp-selector-delete {
    color: var(--pc-error-color, #d32f2f);
}

.dp-selector-delete:hover {
    background: rgba(211, 47, 47, 0.1);
}

.dp-selector-edit .dp-material-icons,
.dp-selector-delete .dp-material-icons {
    font-size: 18px;
}

.dp-selector-list {
    max-height: 300px;
    overflow-y: auto;
}

.dp-selector-item {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 10px 12px;
    border: none;
    background: transparent;
    cursor: pointer;
    transition: background 0.15s;
    text-align: left;
}

.dp-selector-item:hover {
    background: var(--pc-hover-bg, #f5f5f5);
}

.dp-selector-item--selected {
    background: rgba(25, 118, 210, 0.08);
}

.dp-selector-shortcode {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 28px;
    height: 28px;
    border-radius: 4px;
    color: white;
    font-weight: 700;
    font-size: 12px;
}

.dp-selector-name {
    flex: 1;
    font-size: 14px;
    color: var(--rd-font-dark, #232629);
}

.dp-selector-time,
.dp-selector-duration {
    font-size: 12px;
    color: var(--pc-text-secondary, #666);
}

/* ==================== TIME INPUT POPUP ==================== */

.dp-time-input-modal {
    position: fixed;
    z-index: 1000;
    min-width: 240px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    border: 1px solid var(--pc-border-color, #e0e0e0);
    overflow: hidden;
}

.dp-time-input-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    background: var(--pc-bg-secondary, #f8f9fa);
    border-bottom: 1px solid var(--pc-border-color, #e0e0e0);
    font-weight: 500;
    font-size: 13px;
}

.dp-time-input-shortcode {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 28px;
    height: 28px;
    border-radius: 4px;
    color: white;
    font-weight: 700;
    font-size: 12px;
}

.dp-time-input-body {
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.dp-fullday-checkbox {
    display: flex;
    flex-direction: row !important;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    background: var(--pc-bg-secondary, #f8f9fa);
    border-radius: 4px;
    cursor: pointer;
    font-size: 13px !important;
    color: var(--pc-text-primary, #333) !important;
}

.dp-fullday-checkbox input[type="checkbox"] {
    width: 16px;
    height: 16px;
    cursor: pointer;
    accent-color: var(--pc-primary, #2196F3);
}

.dp-fullday-checkbox span {
    font-weight: 500;
}

.dp-time-input-body label {
    display: flex;
    flex-direction: column;
    gap: 4px;
    font-size: 12px;
    color: var(--pc-text-secondary, #666);
}

.dp-time-input-body input[type="time"] {
    padding: 8px 10px;
    border: 1px solid var(--pc-border-color, #e0e0e0);
    border-radius: 4px;
    font-size: 14px;
    font-family: inherit;
}

.dp-time-input-body input[type="date"] {
    padding: 8px 10px;
    border: 1px solid var(--pc-border-color, #e0e0e0);
    border-radius: 4px;
    font-size: 14px;
    font-family: inherit;
}

.dp-time-input-row {
    display: flex;
    gap: 8px;
}

.dp-time-input-row input[type="time"] {
    flex: 1;
}

.dp-time-input-row input[type="date"] {
    flex: 1.2;
}

.dp-time-input-body input[type="time"]:focus,
.dp-time-input-body input[type="date"]:focus {
    outline: none;
    border-color: var(--pc-primary-color, #1976d2);
    box-shadow: 0 0 0 2px rgba(25, 118, 210, 0.1);
}

.dp-time-input-body input[type="time"]:disabled {
    background: var(--pc-bg-secondary, #f8f9fa);
    color: var(--pc-text-secondary, #666);
}

.dp-time-input-hint {
    display: block;
    font-size: 11px;
    color: var(--pc-text-secondary, #888);
    margin-top: 2px;
}

.dp-overnight-indicator {
    display: inline-block;
    background: var(--rd-secondary-active, #4073b6);
    color: white;
    font-size: 10px;
    font-weight: 600;
    padding: 2px 6px;
    border-radius: 4px;
    margin-left: 6px;
    vertical-align: middle;
}

.dp-time-input-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    padding: 10px 12px;
    background: var(--pc-bg-secondary, #f8f9fa);
    border-top: 1px solid var(--pc-border-color, #e0e0e0);
}

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

/* ==================== MODAL ==================== */

.dp-modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.dp-modal {
    background: white;
    border-radius: var(--rd-borderradius-border-lg, 12px);
    box-shadow: 0px 2px 5px rgba(16, 24, 40, 0.1);
    width: 90%;
    max-width: 700px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.dp-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--rd-spacing-lg, 20px) var(--rd-spacing-x-big, 24px);
    border-bottom: 1px solid var(--cl-light-grey, #e0e0e0);
    background: white;
}

.dp-modal-header h2 {
    margin: 0;
    font-size: var(--rd-fontsize-8, 20px);
    font-weight: var(--rd-fontweights-open-sans-1, 600);
    color: var(--rd-font-dark, #232629);
}

.dp-modal-close {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border: none;
    border-radius: var(--rd-borderradius-border-md, 6px);
    background: transparent;
    cursor: pointer;
    transition: background 0.2s;
    color: var(--rd-font-dark, #232629);
}

.dp-modal-close:hover {
    background: var(--rd-input-default, #f5f5f5);
}

.dp-modal-body {
    flex: 1;
    padding: var(--rd-spacing-x-big, 24px);
    overflow-y: auto;
}

.dp-modal-error {
    padding: var(--rd-spacing-md, 12px) var(--rd-spacing-lg, 16px);
    margin-bottom: var(--rd-spacing-lg, 16px);
    background: rgba(211, 47, 47, 0.1);
    color: var(--rd-danger-default, #d32f2f);
    border-radius: var(--rd-borderradius-border-md, 6px);
    font-size: var(--rd-fontsize-3, 13px);
}

/* ==================== DIENSTART FORM ==================== */

.dp-dienstart-form {
    margin-bottom: var(--rd-spacing-x-big, 24px);
    padding-bottom: var(--rd-spacing-x-big, 24px);
    border-bottom: 1px solid var(--cl-light-grey, #e0e0e0);
}

.dp-dienstart-form h3 {
    margin: 0 0 var(--rd-spacing-sm, 12px) 0;
    font-size: var(--rd-fontsize-5, 16px);
    font-weight: var(--rd-fontweights-open-sans-1, 600);
    color: var(--rd-font-dark, #0d1130);
}

/* Form Section Grouping */
.dp-dienstart-form-section {
    padding: var(--rd-spacing-md, 16px);
    background: var(--rd-list-default-dark, #f9fafb);
    border-radius: var(--rd-borderradius-border-md, 4px);
    margin-bottom: var(--rd-spacing-sm, 12px);
}

.dp-dienstart-form-section:last-of-type {
    margin-bottom: var(--rd-spacing-md, 16px);
}

.dp-dienstart-form-section-title {
    font-size: 11px;
    font-weight: 600;
    color: #657587;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: var(--rd-spacing-sm, 12px);
}

.dp-form-row {
    display: flex;
    gap: var(--rd-spacing-sm, 12px);
    margin-bottom: 0;
    flex-wrap: wrap;
    align-items: flex-end;
}

.dp-form-row+.dp-form-row {
    margin-top: var(--rd-spacing-sm, 12px);
}

.dp-form-row label {
    display: flex;
    flex-direction: column;
    gap: var(--rd-spacing-x-sm, 6px);
    font-size: var(--rd-fontsize-3, 13px);
    font-weight: var(--rd-fontweights-open-sans-0, 400);
    color: var(--rd-font-dark, #232629);
    flex: 1;
    min-width: 40px;
}

.dp-form-row label.dp-name-field {
    min-width: 200px;
}

.dp-form-row input[type="text"],
.dp-form-row input[type="number"],
.dp-form-row input[type="time"] {
    padding: var(--rd-spacing-sm, 10px) var(--rd-spacing-md, 12px);
    border: var(--rd-borderwidth-border-default, 1px) solid var(--cl-light-grey, #ccc);
    border-radius: var(--rd-borderradius-border-md, 6px);
    font-size: var(--rd-fontsize-3, 14px);
    color: var(--rd-font-dark, #232629);
    background: white;
    height: 40px;
    box-sizing: border-box;
}

.dp-form-row input[type="text"]:focus,
.dp-form-row input[type="number"]:focus,
.dp-form-row input[type="time"]:focus {
    outline: none;
    border-color: var(--rd-primary-active, #d66181);
    box-shadow: 0 0 0 3px rgba(214, 97, 129, 0.1);
}

.dp-form-row input[type="text"]::placeholder {
    color: var(--cl-light-grey, #999);
}

.dp-form-row input[type="color"] {
    width: 40px;
    height: 40px;
    padding: 2px;
    border: var(--rd-borderwidth-border-default, 1px) solid var(--cl-light-grey, #ccc);
    border-radius: var(--rd-borderradius-border-md, 4px);
    cursor: pointer;
    background: white;
    flex-shrink: 0;
}

.dp-form-row input[type="color"]:focus {
    outline: none;
    border-color: var(--rd-primary-active, #d66181);
    box-shadow: 0 0 0 3px rgba(214, 97, 129, 0.1);
}

/* Color field wrapper for better integration */
.dp-color-field {
    display: flex;
    flex-direction: column;
    gap: var(--rd-spacing-x-sm, 6px);
    flex: 0 0 auto;
    min-width: auto;
}

.dp-color-field-preview {
    display: flex;
    align-items: center;
    gap: var(--rd-spacing-x-sm, 8px);
}

.dp-color-preview-swatch {
    width: 24px;
    height: 24px;
    border-radius: var(--rd-borderradius-border-sm, 2px);
    border: 1px solid rgba(0, 0, 0, 0.1);
}

/* Standalone checkbox row for better visual separation */
.dp-form-checkbox-row {
    display: flex;
    align-items: center;
    padding: var(--rd-spacing-sm, 12px) var(--rd-spacing-md, 16px);
    background: white;
    border-radius: var(--rd-borderradius-border-md, 4px);
    gap: var(--rd-spacing-sm, 12px);
    cursor: pointer;
    transition: background 0.15s ease, border-color 0.15s ease;
    border: 1px solid var(--rd-input-default, #eaecf0);
    margin-top: var(--rd-spacing-sm, 12px);
}

.dp-form-checkbox-row:hover {
    background: var(--rd-list-default-dark, #f9fafb);
}

.dp-form-checkbox-row:has(input:checked) {
    background: rgba(214, 97, 129, 0.08);
    border-color: var(--rd-primary-active, #d66181);
}

.dp-form-checkbox-row input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: var(--rd-primary-active, #d66181);
    cursor: pointer;
    flex-shrink: 0;
}

.dp-form-checkbox-row .dp-checkbox-label {
    font-size: var(--rd-fontsize-4, 14px);
    font-weight: 500;
    color: var(--rd-font-dark, #0d1130);
}

.dp-form-checkbox-row .dp-checkbox-description {
    font-size: 11px;
    color: #657587;
    margin-top: 2px;
}

/* Legacy inline checkbox (keep for backward compatibility) */
.dp-form-checkbox {
    flex-direction: row !important;
    align-items: center !important;
    gap: var(--rd-spacing-x-sm, 8px) !important;
    min-width: auto !important;
    flex: 0 !important;
}

.dp-form-checkbox input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: var(--rd-primary-active, #d66181);
    cursor: pointer;
}

.dp-form-actions {
    display: flex;
    gap: var(--rd-spacing-md, 12px);
    justify-content: flex-end;
    margin-top: var(--rd-spacing-md, 8px);
}

/* ==================== DIENSTART LIST ==================== */

.dp-dienstart-list h3 {
    margin: 0 0 var(--rd-spacing-lg, 16px) 0;
    font-size: var(--rd-fontsize-5, 15px);
    font-weight: var(--rd-fontweights-open-sans-1, 600);
    color: var(--rd-font-dark, #232629);
}

.dp-list-empty {
    color: var(--cl-asphalt-blue, #666);
    font-style: italic;
    font-size: var(--rd-fontsize-3, 13px);
}

.dp-list-items {
    display: flex;
    flex-direction: column;
    gap: var(--rd-spacing-x-sm, 8px);
}

.dp-list-item {
    display: flex;
    align-items: center;
    gap: var(--rd-spacing-sm, 12px);
    padding: var(--rd-spacing-x-sm, 8px) var(--rd-spacing-sm, 12px);
    background: var(--rd-list-default-dark, #f9fafb);
    border-radius: var(--rd-borderradius-border-md, 4px);
    border: 1px solid var(--rd-input-default, #eaecf0);
    transition: border-color 0.15s ease, background 0.15s ease;
}

.dp-list-item:hover {
    background: white;
    border-color: var(--cl-light-grey, #ccc);
}

.dp-dienstart-layout .dp-list-item {
    cursor: pointer;
}

.dp-list-item--editing {
    background: white;
    border-color: var(--rd-primary-active, #d66181);
    box-shadow: 0 0 0 2px rgba(214, 97, 129, 0.15);
}

.dp-list-item--new {
    border-style: dashed;
    margin-bottom: var(--rd-spacing-sm, 12px);
}

.dp-list-item--new .dp-list-name {
    color: var(--cl-asphalt-blue, #666);
}

.dp-list-item--new.dp-list-item--editing {
    border-style: solid;
}

.dp-list-item--new.dp-list-item--editing .dp-list-name {
    color: var(--rd-font-dark, #232629);
}

.dp-list-new-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: var(--rd-borderradius-border-md, 4px);
    background: var(--rd-input-default, #eaecf0);
    color: var(--cl-asphalt-blue, #666);
    font-size: 20px;
    font-weight: 300;
}

.dp-list-item--new.dp-list-item--editing .dp-list-new-icon {
    background: var(--rd-primary-active, #d66181);
    color: white;
}

.dp-list-shortcode {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    height: 36px;
    padding: 0 var(--rd-spacing-x-sm, 8px);
    border-radius: var(--rd-borderradius-border-md, 4px);
    color: var(--rd-font-light, white);
    font-weight: bold;
    font-size: 12px;
    text-shadow: 0 1px 1px rgba(0, 0, 0, 0.15);
}

.dp-list-name {
    flex: 1;
    font-weight: var(--rd-fontweights-open-sans-1, 500);
    font-size: var(--rd-fontsize-4, 14px);
    color: var(--rd-font-dark, #232629);
}

.dp-list-time {
    font-size: var(--rd-fontsize-3, 13px);
    color: var(--cl-asphalt-blue, #666);
}

.dp-list-working {
    font-size: 10px;
    font-weight: 600;
    color: #657587;
    padding: 4px 8px;
    background: white;
    border-radius: 2px;
    border: 1px solid var(--rd-input-default, #eaecf0);
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.dp-list-working--active {
    background: #e7f0d9;
    color: #6e9232;
    border-color: #89b63f;
}

.dp-list-bem {
    font-size: 10px;
    font-weight: 600;
    color: #1976d2;
    padding: 4px 8px;
    background: #e3f2fd;
    border-radius: 2px;
    border: 1px solid #bbdefb;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.dp-list-actions {
    display: flex;
    gap: var(--rd-spacing-x-sm, 4px);
}

/* ==================== BUTTONS ==================== */

.dp-btn {
    padding: var(--rd-spacing-sm, 9px) var(--rd-spacing-md, 16px);
    border: var(--rd-borderwidth-border-default, 1px) solid transparent;
    border-radius: var(--rd-borderradius-border-xl, 20px);
    font-size: var(--rd-fontsize-4, 14px);
    font-weight: var(--rd-fontweights-open-sans-1, 600);
    cursor: pointer;
    transition: all 0.2s;
    line-height: 20px;
    min-width: 100px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.dp-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.dp-btn--primary {
    background: var(--rd-primary-active, #d66181);
    color: white;
    border-color: var(--rd-primary-active, #d66181);
}

.dp-btn--primary:hover:not(:disabled) {
    background: var(--rd-primary-hover, #c45573);
    border-color: var(--rd-primary-hover, #c45573);
}

.dp-btn--secondary {
    background: white;
    color: var(--rd-primary-active, #d66181);
    border-color: var(--rd-primary-active, #d66181);
}

.dp-btn--secondary:hover:not(:disabled) {
    background: var(--rd-primary-hover, #c45573);
    color: white;
    border-color: var(--rd-primary-hover, #c45573);
}

.dp-btn--delete {
    background: white;
    color: var(--rd-error-active, #f54b5e);
    border-color: var(--rd-error-active, #f54b5e);
}

.dp-btn--delete:hover:not(:disabled) {
    background: var(--rd-error-active, #f54b5e);
    color: white;
    border-color: var(--rd-error-active, #f54b5e);
}

/* Icon buttons for list actions (edit/delete) */
.dp-btn-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border: none;
    border-radius: var(--rd-borderradius-border-md, 6px);
    background: transparent;
    cursor: pointer;
    transition: background 0.15s ease;
    position: relative;
}

.dp-btn-icon:hover {
    background: var(--rd-secondary-active, #3578e5);
}

.dp-btn-icon:focus {
    outline: none;
    background: var(--rd-secondary-hover, #2a5db8);
}

/* Edit button - blue icon, white on hover */
.dp-btn-icon.dp-btn-edit::before {
    background-color: var(--rd-secondary-active, #3578e5);
}

.dp-btn-icon.dp-btn-edit:hover::before,
.dp-btn-icon.dp-btn-edit:focus::before {
    background-color: white;
}

/* Delete button - red background on hover */
.dp-btn-icon.dp-btn-delete:hover,
.dp-btn-icon.dp-btn-delete:focus {
    background: var(--rd-danger-default, #d32f2f);
}

.dp-btn-icon.dp-btn-delete::before {
    background-color: var(--rd-danger-default, #d32f2f);
}

.dp-btn-icon.dp-btn-delete:hover::before,
.dp-btn-icon.dp-btn-delete:focus::before {
    background-color: white;
}

/* Override icon margins in button context */
.dp-btn-icon[class*="rd-icon-"]::before {
    transform: scale(1.5);
    margin-right: 0;
}

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

/* ==================== LOADING & ERROR STATES ==================== */

.dp-loading,
.dp-error,
.dp-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 16px;
    padding: 60px 20px;
    color: var(--pc-text-secondary, #666);
}

.dp-loading-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--pc-border-color, #e0e0e0);
    border-top-color: var(--pc-primary-color, #1976d2);
    border-radius: 50%;
    animation: dp-spin 0.8s linear infinite;
}

@keyframes dp-spin {
    to {
        transform: rotate(360deg);
    }
}

.dp-error {
    color: var(--pc-error-color, #d32f2f);
}

.dp-error .dp-material-icons,
.dp-empty .dp-material-icons {
    font-size: 48px;
    opacity: 0.5;
}

/* ==================== PAGINATION ==================== */

.dp-content-wrapper .rd-paginator {
    padding: 16px 20px;
    background: var(--pc-bg-secondary, #f8f9fa);
    border-top: 1px solid var(--pc-border-color, #e0e0e0);
    flex-shrink: 0;
    position: fixed;
    bottom: 0;
    width: calc(100% - 250px);
    z-index: 50;
}

@media (max-width: 1450px) {
    .dp-content-wrapper .rd-paginator {
        width: calc(100%);
    }
}

/* ==================== RESPONSIVE ==================== */

@media (max-width: 768px) {
    .dp-header {
        flex-direction: column;
        gap: 12px;
    }

    .dp-header-nav {
        width: 100%;
        justify-content: space-between;
    }

    .dp-header-actions {
        width: 100%;
    }

    .dp-action-btn {
        flex: 1;
        justify-content: center;
    }

    .dp-employee-name,
    .dp-header-employee {
        min-width: 120px;
        max-width: 120px;
    }

    .dp-cell,
    .dp-header-day {
        min-width: 40px;
        height: 40px;
    }

    .dp-cell-shortcode {
        font-size: 12px;
    }

    .dp-cell-time {
        display: none;
    }

    .dp-form-row {
        flex-direction: column;
    }

    .dp-form-row label {
        min-width: 100%;
    }

    .dp-list-item {
        flex-wrap: wrap;
    }

    .dp-list-time,
    .dp-list-working,
    .dp-list-bem {
        width: 100%;
    }
}

/* ==================== SOLL-ZEIT FEATURE ==================== */

/* Employee row manage button */
.dp-employee-manage {
    opacity: 0;
    margin-left: auto;
    cursor: pointer;
    color: var(--pc-text-secondary, #666);
    flex-shrink: 0;
}

.dp-employee-manage .dp-material-icons {
    font-size: 18px;
}

.dp-employee-name:hover .dp-employee-manage {
    opacity: 1;
}

.dp-employee-manage:hover {
    color: var(--rd-primary-active, #d66181);
}

/* Summary with Soll-Zeit and progress bar */
.dp-summary-hours {
    font-size: var(--rd-fontsize-3, 13px);
    font-weight: 600;
    white-space: nowrap;
}

.dp-summary-progress {
    width: 100%;
    max-width: 60px;
    height: 4px;
    background: var(--pc-border-color, #e0e0e0);
    border-radius: 2px;
    margin-top: 4px;
    overflow: hidden;
}

.dp-summary-progress-bar {
    height: 100%;
    background: var(--rd-success-default, #4caf50);
    border-radius: 2px;
    transition: width 0.3s ease;
}

/* Wide modal variant */
.dp-modal--wide {
    max-width: 600px;
}

/* Dienstart modal - extra wide with side-by-side layout */
.dp-modal--dienstart {
    max-width: 900px;
}

.dp-dienstart-layout {
    display: flex;
    gap: var(--rd-spacing-x-big, 24px);
}

.dp-dienstart-layout-left {
    flex: 0 0 400px;
    max-height: 500px;
    overflow-y: auto;
}

.dp-dienstart-layout-right {
    flex: 1;
    min-width: 0;
}

.dp-dienstart-layout .dp-dienstart-form {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

.dp-dienstart-layout .dp-dienstart-list h3 {
    margin-top: 0;
}

/* ==================== SOLL-ZEIT EDITOR ==================== */

.dp-sollzeit-form {
    margin-bottom: var(--rd-spacing-x-big, 24px);
    padding-bottom: var(--rd-spacing-md, 16px);
    border-bottom: 1px solid var(--cl-light-grey, #e0e0e0);
}

.dp-sollzeit-form h3 {
    margin: 0 0 var(--rd-spacing-sm, 12px) 0;
    font-size: var(--rd-fontsize-5, 16px);
    font-weight: var(--rd-fontweights-open-sans-1, 600);
    color: var(--rd-font-dark, #0d1130);
}

.dp-form-section {
    margin-bottom: var(--rd-spacing-lg, 16px);
}

.dp-form-section>label {
    display: block;
    font-size: var(--rd-fontsize-3, 13px);
    font-weight: var(--rd-fontweights-open-sans-0, 400);
    color: var(--rd-font-dark, #232629);
    margin-bottom: var(--rd-spacing-x-sm, 6px);
}

/* Day toggle buttons */
.dp-sollzeit-days {
    display: flex;
    gap: 4px;
    flex-wrap: wrap;
}

.dp-sollzeit-day {
    padding: 6px 10px;
    border: 1px solid var(--pc-border-color, #ccc);
    border-radius: 4px;
    background: white;
    cursor: pointer;
    font-size: var(--rd-fontsize-3, 13px);
    font-weight: 500;
    color: var(--rd-font-dark, #232629);
    transition: all 0.15s ease;
}

.dp-sollzeit-day:hover {
    border-color: var(--rd-primary-active, #d66181);
}

.dp-sollzeit-day--active {
    background: var(--rd-primary-active, #d66181);
    color: white;
    border-color: var(--rd-primary-active, #d66181);
}

.dp-sollzeit-day--active:hover {
    background: var(--rd-primary-hover, #c45573);
    border-color: var(--rd-primary-hover, #c45573);
}

/* Full-width form row */
.dp-form-row--full {
    flex-direction: column;
}

.dp-form-row--full label {
    width: 100%;
    min-width: 100%;
}

.dp-form-row--full textarea {
    width: 100%;
    padding: var(--rd-spacing-sm, 10px) var(--rd-spacing-md, 12px);
    border: var(--rd-borderwidth-border-default, 1px) solid var(--cl-light-grey, #ccc);
    border-radius: var(--rd-borderradius-border-md, 6px);
    font-size: var(--rd-fontsize-3, 14px);
    color: var(--rd-font-dark, #232629);
    font-family: inherit;
    resize: vertical;
    min-height: 60px;
}

.dp-form-row--full textarea:focus {
    outline: none;
    border-color: var(--rd-primary-active, #d66181);
    box-shadow: 0 0 0 3px rgba(214, 97, 129, 0.1);
}

.dp-form-row select {
    padding: var(--rd-spacing-sm, 10px) var(--rd-spacing-md, 12px);
    border: var(--rd-borderwidth-border-default, 1px) solid var(--cl-light-grey, #ccc);
    border-radius: var(--rd-borderradius-border-md, 6px);
    font-size: var(--rd-fontsize-3, 14px);
    color: var(--rd-font-dark, #232629);
    background: white;
    height: 40px;
    box-sizing: border-box;
    cursor: pointer;
}

.dp-form-row select:focus {
    outline: none;
    border-color: var(--rd-primary-active, #d66181);
    box-shadow: 0 0 0 3px rgba(214, 97, 129, 0.1);
}

.dp-form-row input[type="date"] {
    padding: var(--rd-spacing-sm, 10px) var(--rd-spacing-md, 12px);
    border: var(--rd-borderwidth-border-default, 1px) solid var(--cl-light-grey, #ccc);
    border-radius: var(--rd-borderradius-border-md, 6px);
    font-size: var(--rd-fontsize-3, 14px);
    color: var(--rd-font-dark, #232629);
    background: white;
    height: 40px;
    box-sizing: border-box;
}

.dp-form-row input[type="date"]:focus {
    outline: none;
    border-color: var(--rd-primary-active, #d66181);
    box-shadow: 0 0 0 3px rgba(214, 97, 129, 0.1);
}

/* ==================== SOLL-ZEIT LIST ==================== */

.dp-sollzeit-list h3 {
    margin: 0 0 var(--rd-spacing-sm, 12px) 0;
    font-size: var(--rd-fontsize-5, 15px);
    font-weight: var(--rd-fontweights-open-sans-1, 600);
    color: var(--rd-font-dark, #0d1130);
}

.dp-sollzeit-config {
    border: 1px solid var(--rd-input-default, #eaecf0);
    border-radius: var(--rd-borderradius-border-md, 4px);
    padding: var(--rd-spacing-x-sm, 8px) var(--rd-spacing-sm, 12px);
    margin-bottom: var(--rd-spacing-x-sm, 8px);
    background: var(--rd-list-default-dark, #f9fafb);
    transition: border-color 0.15s ease, background 0.15s ease;
}

.dp-sollzeit-config:hover {
    background: white;
    border-color: var(--cl-light-grey, #ccc);
}

.dp-sollzeit-config:last-child {
    margin-bottom: 0;
}

.dp-sollzeit-config-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--rd-spacing-x-sm, 6px);
}

.dp-sollzeit-config-main {
    display: flex;
    align-items: center;
    gap: var(--rd-spacing-x-sm, 8px);
}

.dp-sollzeit-hours {
    font-size: var(--rd-fontsize-5, 16px);
    font-weight: bold;
    color: var(--rd-font-dark, #0d1130);
}

.dp-sollzeit-type {
    font-size: 12px;
    color: #657587;
}

.dp-sollzeit-time-pref {
    font-size: 11px;
    color: #657587;
    font-style: italic;
}

.dp-sollzeit-config-details {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 12px;
    font-size: 12px;
    color: #657587;
}

.dp-sollzeit-days-label,
.dp-sollzeit-validity {
    white-space: nowrap;
}

.dp-sollzeit-notes {
    margin-top: 6px;
    padding-top: 6px;
    border-top: 1px solid var(--rd-input-default, #eaecf0);
    font-size: 12px;
    color: #657587;
    font-style: italic;
}

/* Per-day badge in config list */
.dp-sollzeit-perday-badge {
    font-size: 10px;
    font-weight: 600;
    background: var(--rd-primary-active, #d66181);
    color: white;
    padding: 2px 6px;
    border-radius: 2px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

/* ==================== SOLL-ZEIT PER-DAY GRID ==================== */

.dp-sollzeit-perday-grid {
    display: flex;
    flex-direction: column;
    gap: var(--rd-spacing-x-sm, 8px);
    margin-top: var(--rd-spacing-sm, 12px);
    padding: var(--rd-spacing-sm, 12px);
    background: white;
    border-radius: var(--rd-borderradius-border-md, 4px);
    border: 1px solid var(--rd-input-default, #eaecf0);
}

.dp-sollzeit-perday-row {
    display: flex;
    align-items: center;
    gap: var(--rd-spacing-sm, 8px);
}

.dp-sollzeit-perday-row--disabled {
    opacity: 0.4;
    pointer-events: none;
}

.dp-sollzeit-perday-label {
    width: 30px;
    font-weight: var(--rd-fontweights-open-sans-1, 600);
    font-size: var(--rd-fontsize-3, 13px);
}

.dp-sollzeit-perday-row input[type="number"] {
    width: 60px;
    padding: var(--rd-spacing-x-sm, 4px) var(--rd-spacing-sm, 8px);
    border: 1px solid var(--pc-border-color, #e0e0e0);
    border-radius: var(--rd-borderradius-border-sm, 4px);
    font-size: var(--rd-fontsize-3, 13px);
    text-align: center;
}

.dp-sollzeit-perday-row input[type="number"]:focus {
    outline: none;
    border-color: var(--rd-primary-default, #1976d2);
}

.dp-sollzeit-perday-row span {
    font-size: var(--rd-fontsize-3, 13px);
    color: var(--pc-text-secondary, #666);
    min-width: 12px;
}

.dp-sollzeit-perday-total {
    margin-top: var(--rd-spacing-sm, 8px);
    padding-top: var(--rd-spacing-sm, 8px);
    border-top: 1px solid var(--pc-border-color, #e0e0e0);
    font-weight: var(--rd-fontweights-open-sans-1, 600);
    font-size: var(--rd-fontsize-4, 14px);
    color: var(--rd-font-dark, #232629);
}

/* ==================== AVAILABILITY TIMES GRID ==================== */

.dp-availability-grid {
    display: flex;
    flex-direction: column;
    gap: var(--rd-spacing-x-sm, 6px);
    margin-top: var(--rd-spacing-sm, 12px);
    padding: var(--rd-spacing-sm, 12px);
    background: white;
    border-radius: var(--rd-borderradius-border-md, 4px);
    border: 1px solid var(--rd-input-default, #eaecf0);
}

.dp-availability-header {
    display: grid;
    grid-template-columns: 50px 80px 1fr 1fr;
    gap: var(--rd-spacing-sm, 8px);
    padding-bottom: var(--rd-spacing-x-sm, 6px);
    border-bottom: 1px solid var(--rd-input-default, #eaecf0);
    font-size: 11px;
    font-weight: 600;
    color: #657587;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.dp-availability-row {
    display: grid;
    grid-template-columns: 50px 80px 1fr 1fr;
    gap: var(--rd-spacing-sm, 8px);
    align-items: center;
    padding: var(--rd-spacing-x-sm, 4px) 0;
}

.dp-availability-row--disabled {
    opacity: 0.4;
}

.dp-availability-row--disabled input[type="time"] {
    pointer-events: none;
}

.dp-availability-dayname {
    font-weight: var(--rd-fontweights-open-sans-1, 600);
    font-size: var(--rd-fontsize-3, 13px);
    color: var(--rd-font-dark, #232629);
}

.dp-availability-row input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: var(--rd-primary-active, #d66181);
    cursor: pointer;
    justify-self: center;
}

.dp-availability-row input[type="time"] {
    padding: var(--rd-spacing-x-sm, 6px) var(--rd-spacing-sm, 10px);
    border: 1px solid var(--pc-border-color, #e0e0e0);
    border-radius: var(--rd-borderradius-border-sm, 4px);
    font-size: var(--rd-fontsize-3, 13px);
    font-family: inherit;
}

.dp-availability-row input[type="time"]:focus {
    outline: none;
    border-color: var(--rd-primary-active, #d66181);
    box-shadow: 0 0 0 2px rgba(214, 97, 129, 0.1);
}

.dp-availability-row input[type="time"]:disabled {
    background: var(--pc-bg-secondary, #f8f9fa);
    color: var(--pc-text-secondary, #999);
    cursor: not-allowed;
}

/* Responsive adjustments for availability grid */
@media (max-width: 480px) {

    .dp-availability-header,
    .dp-availability-row {
        grid-template-columns: 40px 60px 1fr 1fr;
        gap: var(--rd-spacing-x-sm, 4px);
    }

    .dp-availability-row input[type="time"] {
        padding: var(--rd-spacing-x-sm, 4px);
        font-size: 12px;
    }
}

/* Checkbox label for per-day toggle */
.dp-checkbox-label {
    display: flex;
    align-items: center;
    gap: var(--rd-spacing-sm, 8px);
    cursor: pointer;
    font-size: var(--rd-fontsize-4, 14px);
    color: var(--rd-font-dark, #232629);
}

.dp-checkbox-label input[type="checkbox"] {
    width: 16px;
    height: 16px;
    cursor: pointer;
}

/* Loading indicator inline */
.dp-loading-inline {
    padding: var(--rd-spacing-lg, 16px);
    text-align: center;
    color: var(--pc-text-secondary, #666);
    font-size: var(--rd-fontsize-3, 13px);
}

/* ==================== DRAG & DROP ==================== */

/* Ghost element - floating copy during drag */
.dp-drag-ghost {
    position: fixed;
    pointer-events: none;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-width: 48px;
    min-height: 36px;
    padding: 4px 8px;
    border-radius: 4px;
    border-left: 3px solid;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
    opacity: 0.85;
    transform: scale(1.05);
    animation: dp-drag-pickup 0.15s ease-out;
}

.dp-drag-ghost .dp-shift-text {
    font-size: 12px;
    font-weight: 700;
    color: inherit;
}

.dp-drag-ghost .dp-shift-time {
    font-size: 9px;
    opacity: 0.8;
}

/* Pickup animation */
@keyframes dp-drag-pickup {
    0% {
        transform: scale(1);
        opacity: 0.6;
    }

    100% {
        transform: scale(1.05);
        opacity: 0.85;
    }
}

/* Source shift while being dragged */
.dp-shift-item--dragging {
    opacity: 0.3 !important;
    pointer-events: none;
}

/* Drop target cell highlight */
.dp-cell--drag-target {
    background-color: rgba(25, 118, 210, 0.1) !important;
    outline: 2px dashed var(--pc-primary-color, #1976d2);
    outline-offset: -2px;
}

/* Drop preview shift at target location */
.dp-shift-item--drop-preview {
    opacity: 0.7;
    border-style: dashed !important;
    pointer-events: none;
    animation: dp-fade-in 0.15s ease-out;
}

/* Fade-in animation for preview */
@keyframes dp-fade-in {
    0% {
        opacity: 0;
        transform: scale(0.95);
    }

    100% {
        opacity: 0.7;
        transform: scale(1);
    }
}

/* Drop settle animation */
@keyframes dp-drop-settle {
    0% {
        transform: scale(1.05);
        opacity: 0.85;
    }

    50% {
        transform: scale(1.02);
    }

    100% {
        transform: scale(1);
        opacity: 1;
    }
}

/* Shift after drop */
.dp-shift-item--just-dropped {
    animation: dp-drop-settle 0.25s ease-out;
}

/* Hide add button during drag */
.dp-cell-shifts:has(.dp-shift-item--drop-preview) .dp-add-shift-area,
.dp-cell-shifts:has(.dp-shift-item--dragging) .dp-add-shift-area {
    display: none;
}

/* Cursor during drag */
.dp-shift-item {
    cursor: grab;
}

.dp-shift-item:active {
    cursor: grabbing;
}

/* Resize handles should have resize cursor, not grab */
.dp-resize-handle {
    cursor: ew-resize !important;
}

/* ==================== VIEW MODE TOGGLE ==================== */

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

.dp-view-toggle {
    display: flex;
    background: var(--pc-bg-secondary, #f1f3f4);
    border-radius: 8px;
    padding: 4px;
    gap: 2px;
}

.dp-view-toggle-btn {
    padding: 8px 16px;
    border: none;
    border-radius: 6px;
    background: transparent;
    font-size: 13px;
    font-weight: 500;
    color: var(--pc-text-secondary, #5f6368);
    cursor: pointer;
    transition: all 0.2s ease;
}

.dp-view-toggle-btn:hover {
    background: rgba(0, 0, 0, 0.05);
    color: var(--rd-font-dark, #232629);
}

.dp-view-toggle-btn--active {
    background: white;
    color: var(--pc-primary-color, #1976d2);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12);
}

/* ==================== WEEK/DAY NAVIGATION ==================== */

.dp-header-date-display {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 16px;
    background: white;
    border: 1px solid var(--pc-border-color, #e0e0e0);
    border-radius: 6px;
    min-width: 200px;
}

.dp-week-label {
    font-weight: 600;
    font-size: 14px;
    color: var(--pc-primary-color, #1976d2);
}

.dp-date-range {
    font-size: 14px;
    color: var(--rd-font-dark, #232629);
}

.dp-header-date-display--day {
    gap: 8px;
}

.dp-date-input {
    padding: 4px 8px;
    border: 1px solid var(--pc-border-color, #e0e0e0);
    border-radius: 4px;
    font-size: 13px;
    width: 130px;
}

.dp-date-full {
    font-size: 14px;
    font-weight: 500;
    color: var(--rd-font-dark, #232629);
}

/* ==================== WEEK VIEW HEADER ==================== */

.dp-header-dayname-full {
    font-size: 12px;
    font-weight: 500;
    color: var(--rd-font-dark, #232629);
}

.dp-header-date {
    font-size: 11px;
    color: var(--pc-text-secondary, #666);
}

/* ==================== WEEK VIEW GRID ADJUSTMENTS ==================== */

/* Week view: wider cells for 7 columns */
.dp-grid[data-view-mode="week"] .dp-header-day,
.dp-grid[data-view-mode="week"] .dp-cell {
    min-width: calc((100% - 280px) / 7);
    /* Subtract employee (180px) + summary (100px) columns */
    min-width: 100px;
    flex: 1;
}

.dp-grid[data-view-mode="week"] .dp-header-day {
    padding: 12px 8px;
}

.dp-grid[data-view-mode="week"] .dp-header-dayname-full {
    font-size: 13px;
    font-weight: 600;
}

.dp-grid[data-view-mode="week"] .dp-shift-item {
    padding: 6px 10px;
    font-size: 13px;
}

.dp-grid[data-view-mode="week"] .dp-cell-time {
    display: inline;
    font-size: 11px;
}

.dp-grid[data-view-mode="week"] .dp-cell-shortcode {
    font-size: 12px;
    font-weight: 600;
}

/* ==================== DAY VIEW GRID ADJUSTMENTS ==================== */

/* Day view: single wide column */
.dp-grid[data-view-mode="day"] .dp-header-days,
.dp-grid[data-view-mode="day"] .dp-row-cells {
    flex: 1;
}

.dp-grid[data-view-mode="day"] .dp-header-day,
.dp-grid[data-view-mode="day"] .dp-cell {
    min-width: 100%;
    flex: 1;
}

.dp-grid[data-view-mode="day"] .dp-header-day {
    justify-content: flex-start;
    flex-direction: row;
    gap: 12px;
    padding: 12px 16px;
}

.dp-grid[data-view-mode="day"] .dp-header-dayname-full {
    font-size: 14px;
    font-weight: 600;
}

.dp-grid[data-view-mode="day"] .dp-header-date {
    font-size: 14px;
    color: var(--pc-text-secondary, #666);
}

.dp-grid[data-view-mode="day"] .dp-shift-item {
    padding: 10px 16px;
    font-size: 14px;
}

.dp-grid[data-view-mode="day"] .dp-cell-shortcode {
    font-size: 14px;
    font-weight: 600;
}

.dp-grid[data-view-mode="day"] .dp-cell-time {
    display: inline;
    font-size: 13px;
    margin-left: 8px;
}

.dp-grid[data-view-mode="day"] .dp-cell-shifts {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 8px;
}

.dp-grid[data-view-mode="day"] .dp-add-shift-area {
    flex: 0 0 auto;
}

/* ==================== SUMMARY SECTION ==================== */

pc-dienstplan-summary {
    display: block;
    border-top: 2px solid var(--pc-border-color, #e0e0e0);
    margin-top: 8px;
}

.dp-summary-section {
    display: flex;
    flex-direction: column;
}

/* Tab bar wrapper - aligns with grid columns */
.dp-summary-tabs-wrapper {
    display: flex;
    background: var(--pc-bg-secondary, #f8f9fa);
    border-bottom: 1px solid var(--pc-border-color, #e0e0e0);
}

.dp-summary-tabs-label {
    position: sticky;
    left: 0;
    min-width: 180px;
    max-width: 180px;
    background: var(--pc-bg-secondary, #f8f9fa);
    border-right: 2px solid var(--pc-border-color, #e0e0e0);
    z-index: 2;
}

.dp-summary-tabs {
    display: flex;
    flex: 1;
    list-style: none;
    margin: 0;
    padding: 0;
    gap: 0;
}

.dp-summary-tab {
    position: relative;
}

.dp-summary-tab a {
    display: block;
    padding: 12px 20px;
    font-size: 13px;
    font-weight: 500;
    color: var(--pc-text-secondary, #666);
    text-decoration: none;
    transition: all 0.2s;
    cursor: pointer;
}

.dp-summary-tab a:hover {
    color: var(--rd-font-dark, #232629);
    background: rgba(0, 0, 0, 0.03);
}

.dp-summary-tab--active a {
    color: var(--rd-success-default, #4caf50);
    font-weight: 600;
}

.dp-summary-tab--active::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--rd-success-default, #4caf50);
    border-radius: 3px 3px 0 0;
}

.dp-summary-tabs-total {
    position: sticky;
    right: 0;
    min-width: 100px;
    max-width: 100px;
    background: var(--pc-bg-secondary, #f8f9fa);
    border-left: 2px solid var(--pc-border-color, #e0e0e0);
    z-index: 2;
}

/* Summary grid container */
.dp-summary-grid {
    display: flex;
    flex-direction: column;
}

/* Summary row */
.dp-summary-row {
    display: flex;
    border-bottom: 1px solid var(--pc-border-color, #e0e0e0);
}

.dp-summary-row:last-child {
    border-bottom: none;
}

.dp-summary-row:hover {
    background: rgba(0, 0, 0, 0.01);
}

/* Summary label column (sticky left) */
.dp-summary-label {
    position: sticky;
    left: 0;
    min-width: 180px;
    max-width: 180px;
    padding: 10px 12px;
    background: white;
    border-right: 2px solid var(--pc-border-color, #e0e0e0);
    z-index: 10;
    display: flex;
    align-items: center;
    gap: 10px;
}

.dp-summary-shortcode {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 28px;
    height: 24px;
    padding: 0 6px;
    border-radius: 4px;
    color: white;
    font-weight: 700;
    font-size: 11px;
    text-shadow: 0 1px 1px rgba(0, 0, 0, 0.15);
}

.dp-summary-name {
    font-size: 13px;
    font-weight: 500;
    color: var(--rd-font-dark, #232629);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Summary cells container */
.dp-summary-cells {
    display: flex;
    flex: 1;
}

/* Individual summary cell */
.dp-summary-cell {
    min-width: 48px;
    min-height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-right: 1px solid var(--pc-border-color, #e0e0e0);
    flex: 1;
}

.dp-summary-cell--weekend {
    background-color: rgba(0, 0, 0, 0.02);
}

.dp-summary-cell--today {
    background: rgba(25, 118, 210, 0.08);
}

.dp-summary-cell-count {
    font-size: 13px;
    font-weight: 600;
    color: var(--rd-font-dark, #232629);
}

.dp-summary-cell-count--zero {
    color: var(--pc-text-secondary, #999);
    font-weight: 400;
}

/* Summary total column (sticky right) */
.dp-summary-total {
    position: sticky;
    right: 0;
    min-width: 100px;
    max-width: 100px;
    padding: 10px 8px;
    background: white;
    border-left: 2px solid var(--pc-border-color, #e0e0e0);
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
}

.dp-summary-total .dp-summary-count {
    font-size: 14px;
    font-weight: 700;
    color: var(--rd-font-dark, #232629);
}

/* Empty state */
.dp-summary-empty {
    padding: 20px;
    text-align: center;
    color: var(--pc-text-secondary, #999);
    font-style: italic;
    font-size: 13px;
}

/* ==================== SUMMARY SECTION - VIEW MODE ADJUSTMENTS ==================== */

/* Week view: wider summary cells */
.dp-grid[data-view-mode="week"]+pc-dienstplan-summary .dp-summary-cell,
pc-dienstplan-summary[data-view-mode="week"] .dp-summary-cell {
    min-width: 100px;
}

/* Day view: single summary cell */
.dp-grid[data-view-mode="day"]+pc-dienstplan-summary .dp-summary-cells,
pc-dienstplan-summary[data-view-mode="day"] .dp-summary-cells {
    flex: 1;
}

.dp-grid[data-view-mode="day"]+pc-dienstplan-summary .dp-summary-cell,
pc-dienstplan-summary[data-view-mode="day"] .dp-summary-cell {
    min-width: 100%;
    flex: 1;
}

/* Responsive */
@media (max-width: 768px) {

    .dp-summary-label,
    .dp-summary-tabs-label {
        min-width: 120px;
        max-width: 120px;
    }

    .dp-summary-name {
        font-size: 12px;
    }

    .dp-summary-cell {
        min-width: 40px;
    }
}