/* =============================================
   Enhancements — visual polish layer
   Sits on top of main.css. Adds refinements
   without overriding layout or structure.
   Light theme — matches the white-ish base.
   ============================================= */


/* ----- CARD REFINEMENTS ----- */

#content .card {
    overflow: hidden;
}

.data-table td.selection-checkbox,
.data-table th.selection-checkbox {
    flex: 0;
}

/* ----- TOOLBAR ----- */


.toolbar .action-button:not(:disabled):hover {
    box-shadow: 0 2px 8px hsl(var(--hue), var(--sat), 60%, .25);
}



/* ----- INLINE ROW ACTIONS ----- */
/*
.inline-action {
    padding: var(--p1) var(--p2);
    background: transparent;
    border: 1px solid transparent;
    border-radius: var(--rad-2);
    color: var(--grey-600);
    font-size: .85em;
    transition:
        color .15s ease,
        background .15s ease,
        border-color .15s ease;
    min-width: unset;
}

.inline-action:hover {
    color: var(--accent-400);
    background: hsl(var(--hue), 30%, 95%);
    border-color: var(--accent-700);
}


/* ----- SEARCH INPUT -----

.data-search-input {
    background: var(--white);
    border-color: var(--grey-800);
    color: var(--grey-200);
    transition: border-color .2s ease, box-shadow .2s ease;
}

.data-search-input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 2px hsl(var(--hue), var(--sat), 70%, .2);
}

.data-search-icon {
    background: hsl(var(--hue), 12%, 96%);
    border-color: var(--grey-800);
    transition: color .2s ease;
}

.data-search-input:focus+.data-search-icon,
.data-search-input:focus~.data-search-icon {
    color: var(--accent-450);
}


/* ----- CHECKBOXES -----

.data-table input[type="checkbox"] {
    appearance: none;
    width: 1rem;
    height: 1rem;
    border: 1.5px solid var(--grey-700);
    border-radius: var(--rad-3);
    background: var(--white);
    cursor: pointer;
    transition:
        background .15s ease,
        border-color .15s ease,
        box-shadow .15s ease;
    position: relative;
}

.data-table input[type="checkbox"]:hover {
    border-color: var(--accent-500);
}

.data-table input[type="checkbox"]:checked {
    background: var(--accent-500);
    border-color: var(--accent-450);
    box-shadow: 0 0 4px hsl(var(--hue), var(--sat), 60%, .25);
}

.data-table input[type="checkbox"]:checked::after {
    content: '';
    position: absolute;
    top: 31px;
    left: 40px;
    width: 40px;
    height: 8px;
    border: solid var(--white);
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}


/* ----- DIALOG / OVERLAY MODALS ----- */

dialog.overlay-modal {
    border: 1px solid var(--grey-850);
    border-radius: var(--rad-4);
    background: linear-gradient(180deg,
            var(--white),
            hsl(var(--hue), 8%, 97%));
    color: var(--grey-250);
    padding: 0;
    box-shadow:
        0 8px 32px var(--opaque-200),
        0 0 1px var(--grey-700),
        inset 0 0 0 4px hsl(var(--hue), 15%, 96%);
    animation: dialog-in .2s ease-out;
    max-width: min(480px, 90vw);
    width: 100%;
}

@keyframes dialog-in {
    from {
        opacity: 0;
        transform: translateY(12px) scale(.97);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

dialog.overlay-modal::backdrop {
    backdrop-filter: blur(4px) saturate(.7);
    background: hsl(var(--hue), 10%, 30%, .35);
}

dialog .overlay-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom-color: var(--grey-850);
}

dialog .overlay-title {
    font-family: var(--text-font);
    font-weight: 700;
    font-size: var(--font-size-2);
    letter-spacing: .04rem;
    color: var(--accent-350);
}

dialog .overlay-close {
    background: transparent;
    border: none;
    font-size: var(--font-size-4);
    color: var(--grey-500);
    width: 2rem;
    height: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    min-width: unset;
    cursor: pointer;
    flex-shrink: 0;
    transition: color .15s ease;
}

dialog .overlay-close:hover {
    color: var(--error);
}


/* ----- FORM FIELDS INSIDE DIALOGS ----- */

dialog .form-row {
    display: flex;
    flex-direction: column;
    gap: var(--g1);
    padding: var(--p2) 0;
}

dialog .form-row label {
    font-size: var(--font-small);
    font-weight: 600;
    color: var(--grey-400);
    letter-spacing: .03rem;
}

/*
dialog .form-row input,
dialog .form-row select,
dialog .form-row textarea {
    background: var(--white);
    border: 1px solid var(--grey-800);
    border-radius: var(--rad-2);
    padding: var(--p2) var(--p3);
    color: var(--grey-200);
    transition:
        border-color .2s ease,
        box-shadow .2s ease;
}
        */

dialog .form-row input:focus,
dialog .form-row select:focus,
dialog .form-row textarea:focus {
    border-color: var(--accent-500);
    box-shadow: 0 0 0 3px hsl(var(--hue), var(--sat), 65%, .15);
    outline: none;
}

dialog .card-body {
    padding: var(--p3) var(--p4);
}


/* ----- TOGGLE SWITCH (checkbox in dialogs) ----- */

dialog .form-row input[type="checkbox"] {
    appearance: none;
    position: relative;
    width: 2.5rem;
    height: 1.3rem;
    background: var(--grey-800);
    border: none;
    border-radius: var(--rad-full);
    cursor: pointer;
    transition: background .2s ease;
}

dialog .form-row input[type="checkbox"]::after {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: calc(1.3rem - 4px);
    height: calc(1.3rem - 4px);
    background: var(--white);
    border-radius: 50%;
    box-shadow: 0 1px 3px var(--opaque-200);
    transition: transform .2s ease;
}

dialog .form-row input[type="checkbox"]:checked {
    background: var(--accent-500);
}

dialog .form-row input[type="checkbox"]:checked::after {
    transform: translateX(1.2rem);
}

dialog .form-row input[type="checkbox"]:hover {
    background: var(--grey-700);
}

dialog .form-row input[type="checkbox"]:checked:hover {
    background: var(--accent-450);
}


/* ----- DELETE PREVIEW (inside delete dialog) ----- */

.dialog-delete-selection {
    margin-bottom: var(--p3);
}

.dialog-delete-selection .dialog-form-label {
    font-size: var(--font-small);
    color: var(--grey-500);
    font-weight: 600;
    margin-bottom: var(--p1);
}

.dialog-delete-selection .table-wrapper {
    max-height: 180px;
    overflow-y: auto;
    border: 1px solid hsl(0, 30%, 90%);
    border-radius: var(--rad-2);
}

.dialog-delete-selection .data-table {
    font-size: var(--font-small);
}

.dialog-delete-selection .data-table td,
.dialog-delete-selection .data-table th {
    padding: var(--p1) var(--p2);
}


/* ----- DESTRUCTIVE DIALOG (delete confirm) ----- */

dialog#overlay-dialog-delete .overlay-title {
    color: var(--error-dark);
}

dialog#overlay-dialog-delete .button.primary {
    background: linear-gradient(0deg, hsl(0, 55%, 45%), hsl(0, 55%, 55%));
    border-color: hsl(0, 60%, 40%);
    color: var(--white);
}

dialog#overlay-dialog-delete .button.primary:hover {
    background: linear-gradient(0deg, hsl(0, 65%, 40%), hsl(0, 65%, 50%));
    box-shadow: 0 2px 8px hsl(0, 60%, 50%, .3);
}

/* ----- CONFIRM OVERLAY (stacked dialog) ----- */

dialog.confirm-overlay {
    max-width: min(420px, 85vw);
    z-index: 100;
}

dialog.confirm-overlay::backdrop {
    background: hsl(0, 10%, 20%, .4);
    backdrop-filter: blur(2px);
}

dialog.confirm-overlay .overlay-title.error {
    color: var(--error-dark);
}

.confirm-hint {
    font-size: var(--font-small);
    color: var(--grey-400);
    margin: 0 0 var(--p2) 0;
}

.confirm-entries {
    display: flex;
    flex-direction: column;
    gap: var(--p2);
    max-height: 240px;
    overflow-y: auto;
}

.confirm-entry {
    display: flex;
    flex-wrap: wrap;
    gap: var(--p1) var(--p3);
    padding: var(--p2) var(--p3);
    border-radius: var(--rad-2);
    background: hsl(0, 40%, 97%);
    border: 1px solid hsl(0, 30%, 90%);
    font-size: var(--font-small);
}

.confirm-field {
    display: inline-flex;
    align-items: center;
    gap: var(--p1);
}

.confirm-field-label {
    color: var(--grey-500);
    font-weight: 600;
    text-transform: uppercase;
    font-size: .7em;
    letter-spacing: .04rem;
}

.confirm-field-label::after {
    content: ':';
}

.confirm-field-value {
    color: var(--grey-200);
    font-family: var(--monospace-font);
}

dialog.confirm-overlay .button.primary.destructive {
    background: linear-gradient(0deg, hsl(0, 55%, 45%), hsl(0, 55%, 55%));
    border-color: hsl(0, 60%, 40%);
    color: var(--white);
}

dialog.confirm-overlay .button.primary.destructive:hover {
    background: linear-gradient(0deg, hsl(0, 65%, 40%), hsl(0, 65%, 50%));
    box-shadow: 0 2px 8px hsl(0, 60%, 50%, .3);
}


/* ----- DIALOG FOOTER BUTTONS ----- */

dialog .overlay-actions {
    display: flex;
    justify-content: flex-end;
    gap: var(--g2);
    padding: var(--p3) var(--p4);
    border-top: 1px solid var(--grey-850);
}

dialog .overlay-actions button {
    border-radius: var(--rad-3);
    padding: var(--p2) var(--p4);
    font-weight: 500;
    letter-spacing: .03rem;
    transition:
        background .15s ease,
        border-color .15s ease,
        box-shadow .15s ease;
}

dialog .overlay-actions .button.primary {
    background: linear-gradient(0deg, var(--grey-850), var(--grey-950));
    border: 1px solid var(--grey-750);
    color: var(--grey-200);
    font-weight: 700;
}

dialog .overlay-actions .button.primary:hover {
    background: linear-gradient(0deg, var(--accent-350), var(--accent-500));
    border-color: var(--accent-250);
    color: var(--font-light);
    box-shadow: 0 2px 8px hsl(var(--hue), var(--sat), 50%, .2);
}

dialog .overlay-actions .button:not(.primary) {
    background: linear-gradient(0deg, var(--grey-850), var(--grey-950));
    border: 1px solid var(--grey-750);
    color: var(--grey-400);
}

dialog .overlay-actions .button:not(.primary):hover {
    background: linear-gradient(0deg, var(--grey-900), var(--grey-950));
    border-color: var(--grey-700);
    color: var(--grey-200);
}


/* ----- RETURN MESSAGE ----- */

.dialog-return-message {
    padding: 0 var(--p4);
    max-height: 0;
    overflow: hidden;
    transition: max-height .3s ease, padding .3s ease;
}

.dialog-return-message.visible {
    max-height: 200px;
    padding: var(--p2) var(--p4);
}

.dialog-return-row.tag {
    padding: var(--p2) var(--p3);
    border-radius: var(--rad-2);
    margin-bottom: var(--p1);
    font-size: var(--font-small);
    font-family: var(--monospace-font);
}


/* ----- PASSWORD TOGGLE ----- */

.input-icon-wrap {
    position: relative;
    display: flex;
    align-items: stretch;
}

.input-icon-wrap input {
    flex: 1;
    padding-right: 2.5rem;
}

.password-view-icon {
    position: absolute;
    right: 0;
    top: 0;
    bottom: 0;
    display: flex;
    align-items: center;
    padding: 0 var(--p3);
    cursor: pointer;
    color: var(--grey-600);
    transition: color .15s ease;
}

.password-view-icon:hover {
    color: var(--accent-500);
}


/* ----- SCROLLBAR (webkit) ----- */

.table-wrapper {
    overflow-x: auto;
}

.table-wrapper::-webkit-scrollbar {
    height: 6px;
}

.table-wrapper::-webkit-scrollbar-track {
    background: var(--grey-950);
    border-radius: 3px;
}

.table-wrapper::-webkit-scrollbar-thumb {
    background: var(--accent-700);
    border-radius: 3px;
}

.table-wrapper::-webkit-scrollbar-thumb:hover {
    background: var(--accent-600);
}


/* ----- EMPTY STATE ----- */

.content-body:empty::after {
    content: 'Keine Eintr\00E4ge vorhanden';
    display: flex;
    justify-content: center;
    padding: var(--p6);
    color: var(--grey-600);
    font-style: italic;
    letter-spacing: .03rem;
}

/* ----- WORK EDIT — SPLIT ROWS ----- */

.form-section-head {
    display: flex;
    align-items: baseline;
    gap: var(--g3);
    margin-bottom: var(--m2);
}

.split-duration {
    font-size: var(--font-sm);
    font-weight: 600;
    color: var(--accent);
}

.split-list {
    display: flex;
    flex-direction: column;
    gap: var(--g2);
    margin-bottom: var(--m3);
}

.split-row {
    display: flex;
    align-items: flex-end;
    gap: var(--g3);
    padding: var(--p3);
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: var(--rad-2);
}

.split-field {
    flex: 1 1 200px;
    min-width: 0;
}

.split-field .form-input {
    padding: var(--p2) var(--p3);
    height: 2.25rem;
}

.split-sep {
    flex: 0 0 auto;
    color: var(--text-3);
    padding-bottom: 0.35rem;
    font-weight: 500;
}

.split-billable {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    gap: var(--g2);
    padding-bottom: 0.2rem;
    font-size: var(--font-sm);
    color: var(--text-2);
    cursor: pointer;
    white-space: nowrap;
}

.split-billable input[type="checkbox"] {
    width: 1rem;
    height: 1rem;
    accent-color: var(--accent);
    cursor: pointer;
}

.split-remove {
    flex: 0 0 auto;
    margin-bottom: 0.1rem;
    color: var(--text-3);
}

.split-remove:hover {
    color: var(--danger, #c0392b);
}

.split-add-btn {
    font-size: var(--font-sm);
    color: var(--accent);
    background: none;
    border: 1px dashed var(--border-strong);
    border-radius: var(--rad-2);
    padding: var(--p2) var(--p4);
    cursor: pointer;
    width: 100%;
    text-align: center;
    margin-bottom: var(--m3);
    transition: background .15s, border-color .15s;
}

.split-add-btn:hover {
    background: var(--surface-2);
    border-color: var(--accent);
}

.split-error {
    margin-top: calc(-1 * var(--g2));
}

@media (max-width: 640px) {
    .split-row {
        flex-wrap: wrap;
    }
    .split-sep {
        display: none;
    }
}

/* ── Work log (task detail — Arbeitszeiten card) ───────────── */

.work-log {
    display: flex;
    flex-direction: column;
}

.work-entry {
    padding: 10px 18px;
    border-bottom: 1px solid var(--border);
    transition: background 80ms;
}

.work-entry:last-child,
.work-log-older .work-entry:last-child {
    border-bottom: 0;
}

.work-entry:hover {
    background: var(--surface-2);
}

.work-entry-main {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}

.work-entry-when {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
    flex-wrap: wrap;
}

.work-date {
    font-size: 13px;
    font-weight: 500;
    color: var(--text);
    white-space: nowrap;
}

.work-range {
    font-family: 'IBM Plex Mono', 'Source Code Pro', ui-monospace, monospace;
    font-size: 12.5px;
    color: var(--text-2);
    white-space: nowrap;
}

.work-duration {
    display: inline-flex;
    align-items: center;
    padding: 2px 8px;
    background: var(--accent-soft);
    color: var(--accent-text);
    border-radius: 999px;
    font-size: 11.5px;
    font-weight: 600;
    font-family: 'IBM Plex Mono', 'Source Code Pro', ui-monospace, monospace;
    white-space: nowrap;
}

.work-entry-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.work-user {
    font-size: 11.5px;
    color: var(--text-3);
    font-family: 'IBM Plex Mono', 'Source Code Pro', ui-monospace, monospace;
}

.work-billed-tag {
    display: inline-flex;
    padding: 2px 7px;
    background: oklch(0.94 0.05 150);
    color: oklch(0.42 0.13 150);
    border-radius: 999px;
    font-size: 10.5px;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

html[data-theme="dark"] .work-billed-tag {
    background: oklch(0.28 0.07 150);
    color: oklch(0.72 0.13 150);
}

.work-entry-actions {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-shrink: 0;
    min-width: 72px;
    justify-content: flex-end;
}

.work-entry-comment {
    margin-top: 6px;
    padding: 6px 10px;
    background: var(--surface-2);
    border-left: 2px solid var(--border-strong);
    border-radius: 0 var(--radius) var(--radius) 0;
    font-size: 12.5px;
    color: var(--text-2);
    line-height: 1.55;
    white-space: pre-wrap;
}

/* Older entries disclosure */
.work-log-older {
    border-top: 1px solid var(--border);
}

.work-log-older > summary {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 18px;
    font-size: 12.5px;
    color: var(--text-3);
    cursor: pointer;
    list-style: none;
    user-select: none;
    transition: color 80ms;
}

.work-log-older > summary::-webkit-details-marker { display: none; }

.work-log-older > summary::before {
    content: '\203A';
    font-size: 14px;
    line-height: 1;
    transition: transform 160ms;
    display: inline-block;
}

.work-log-older[open] > summary::before {
    transform: rotate(90deg);
}

.work-log-older > summary:hover {
    color: var(--text);
}
