/*
 * Projektstyring MVP
 * Filversion: 1.46.0
 * Sidst aendret: 06.05.2026
 * Ansvar: Layout, komponenter, login og visuel styling.
 * Changelog 1.46.0: Statusblokken i opgaveheaderen er gjort mere kompakt.
 * Changelog 1.43.0: Opgavemodalens statusblok i headeren er stylet separat.
 * Changelog 1.34.0: Kunde og titel kan spænde over hele opgaveformularens bredde.
 */
:root {
    --app-bg: #f5f7fa;
    --app-border: #dfe5ec;
    --app-text: #1f2933;
}

body {
    background: var(--app-bg);
    color: var(--app-text);
}

.auth-page {
    min-height: 100vh;
    background:
        linear-gradient(135deg, rgba(13, 110, 253, .10), rgba(32, 201, 151, .08)),
        #f5f7fa;
}

.auth-shell {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 1.25rem;
}

.auth-card {
    width: min(100%, 460px);
    background: #fff;
    border: 1px solid var(--app-border);
    border-radius: 8px;
    padding: 2rem;
    box-shadow: 0 20px 60px rgba(15, 23, 42, .10);
}

.auth-brand {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.auth-brand-icon {
    display: grid;
    place-items: center;
    width: 52px;
    height: 52px;
    border-radius: 8px;
    background: #0d6efd;
    color: #fff;
    font-size: 1.45rem;
}

.navbar .nav-link.active {
    color: #0d6efd;
    font-weight: 600;
}

.page-heading {
    max-width: 1800px;
    margin-inline: auto;
}

.content-panel {
    background: #fff;
    border: 1px solid var(--app-border);
    border-radius: 8px;
    padding: 1rem;
    max-width: 1800px;
    margin-inline: auto;
}

#taskModal .modal-header {
    align-items: center;
    gap: .85rem;
}

.task-modal-title {
    min-width: 0;
    flex: 1 1 auto;
}

.task-header-status {
    --task-status-color: #0d6efd;
    flex: 0 1 220px;
    min-width: 180px;
    border: 1px solid var(--app-border);
    border-left: 3px solid var(--task-status-color);
    border-radius: 8px;
    background: #fff;
    padding: .3rem .45rem;
}

.task-header-status-label {
    color: #667085;
    font-size: .68rem;
    line-height: 1;
}

.task-header-status-display {
    display: flex;
    align-items: center;
    gap: .35rem;
    width: 100%;
    min-height: 1.35rem;
    margin-top: .05rem;
    padding: 0;
    color: var(--app-text);
    background: transparent;
    border: 0;
    text-align: left;
    font-size: .9rem;
    font-weight: 700;
}

.task-header-status-display:hover {
    color: #0d6efd;
}

.task-header-status-dot {
    width: .65rem;
    height: .65rem;
    border-radius: 999px;
    background: var(--task-status-color);
    flex: 0 0 auto;
}

.task-header-status-save-state {
    min-height: .65rem;
    margin-top: .1rem;
    color: #667085;
    font-size: .68rem;
}

@media (max-width: 767.98px) {
    #taskModal .modal-header {
        align-items: stretch;
    }

    .task-header-status {
        order: 2;
        flex-basis: 100%;
        min-width: 0;
    }
}

.summary-tile {
    display: flex;
    align-items: center;
    gap: 1rem;
    min-height: 96px;
    padding: 1rem;
    color: inherit;
    text-decoration: none;
    background: #fff;
    border: 1px solid var(--app-border);
    border-radius: 8px;
    transition: transform .12s ease, box-shadow .12s ease;
}

.summary-tile:hover {
    transform: translateY(-1px);
    box-shadow: 0 10px 26px rgba(15, 23, 42, .08);
}

.summary-tile strong {
    display: block;
    font-size: 1.75rem;
    line-height: 1;
}

.summary-tile small {
    display: block;
    color: #667085;
    margin-top: .35rem;
}

.summary-icon {
    display: grid;
    place-items: center;
    width: 48px;
    height: 48px;
    border-radius: 8px;
    flex: 0 0 auto;
    font-size: 1.35rem;
}

.clickable-row {
    cursor: pointer;
}

.task-row-overdue > td:first-child {
    box-shadow: inset 4px 0 0 #dc3545;
}

.task-row-soon > td:first-child {
    box-shadow: inset 4px 0 0 #ffc107;
}

.task-row-closed {
    opacity: .72;
}

.table th[data-sort] {
    cursor: pointer;
    user-select: none;
}

.table th[data-sort]::after {
    content: "\F282";
    font-family: "bootstrap-icons";
    font-size: .7rem;
    margin-left: .35rem;
    color: #98a2b3;
}

.task-inline-select {
    min-width: 8.5rem;
}

.task-inline-date {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .35rem;
    min-width: 10rem;
}

.task-inline-date-input {
    width: 9.5rem;
}

.status-dot {
    width: .75rem;
    height: .75rem;
    border-radius: 50%;
    display: inline-block;
    flex: 0 0 auto;
}

.kanban-board {
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: minmax(280px, 320px);
    gap: 1rem;
    min-height: 65vh;
    overflow-x: auto;
    padding-bottom: .5rem;
}

.kanban-column {
    background: #f8fafc;
    border: 1px solid var(--app-border);
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    min-height: 56vh;
}

.kanban-header {
    display: flex;
    align-items: center;
    gap: .5rem;
    padding: .85rem;
    border-bottom: 1px solid var(--app-border);
    font-weight: 600;
    font-size: .95rem;
}

.kanban-dropzone {
    padding: .75rem;
    display: grid;
    gap: .75rem;
    align-content: start;
    min-height: 100%;
    flex: 1;
}

.kanban-dropzone.drag-over {
    background: rgba(13, 110, 253, .08);
    outline: 2px dashed rgba(13, 110, 253, .35);
    outline-offset: -6px;
}

.task-card {
    background: #fff;
    border: 1px solid var(--app-border);
    border-radius: 8px;
    padding: .85rem;
    cursor: grab;
    box-shadow: 0 1px 2px rgba(16, 24, 40, .04);
}

.task-card:active {
    cursor: grabbing;
}

.task-card-title {
    font-weight: 700;
    line-height: 1.25;
}

.task-card-meta {
    display: flex;
    flex-wrap: wrap;
    gap: .45rem;
    color: #667085;
    font-size: .82rem;
    margin-top: .5rem;
}

.task-card-meta .badge,
.js-checkpoint-overview .badge,
.js-work-card-overview .badge,
.js-note-overview .badge {
    display: inline-flex;
    align-items: center;
    width: fit-content;
}

.customer-summary {
    border: 1px solid var(--app-border);
    border-radius: 8px;
    background: #f8fafc;
    padding: .85rem;
}

.customer-summary-title,
.customer-summary-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .55rem .9rem;
}

.customer-summary-title {
    justify-content: space-between;
    font-weight: 700;
}

.customer-summary-meta {
    margin-top: .55rem;
    color: #667085;
    font-size: .9rem;
}

.customer-summary-meta a {
    color: inherit;
    text-decoration: none;
}

.customer-summary-meta a:hover {
    color: #0d6efd;
    text-decoration: underline;
}

.task-workflow {
    border: 1px solid var(--app-border);
    border-radius: 8px;
    background: #f8fafc;
    padding: .85rem;
}

.workflow-header,
.workflow-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .6rem;
}

.workflow-header {
    justify-content: space-between;
    margin-bottom: .75rem;
}

.workflow-strip {
    display: flex;
    gap: .45rem;
    overflow-x: auto;
    padding-bottom: .15rem;
}

.workflow-step {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    min-height: 2.25rem;
    padding: .35rem .55rem;
    color: #344054;
    background: #fff;
    border: 1px solid var(--app-border);
    border-radius: 8px;
    white-space: nowrap;
}

.workflow-step.done {
    color: #198754;
    border-color: rgba(25, 135, 84, .35);
}

.workflow-step.active {
    color: #fff;
    background: #0d6efd;
    border-color: #0d6efd;
}

.workflow-step-dot {
    display: inline-grid;
    place-items: center;
    width: 1.25rem;
    height: 1.25rem;
    border-radius: 999px;
    color: #fff;
    font-size: .72rem;
    flex: 0 0 auto;
}

.task-overview-progress {
    margin-bottom: 1rem;
}

.task-overview-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(360px, 1fr);
    gap: .85rem;
}

.task-overview-panel {
    border: 1px solid var(--app-border);
    border-radius: 8px;
    background: #fff;
    padding: .9rem;
    min-width: 0;
}

.task-overview-fields,
.task-overview-meta {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: .75rem;
    margin-bottom: .85rem;
}

.task-overview-meta {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.task-inline-field {
    min-width: 0;
}

.task-inline-field-full {
    grid-column: 1 / -1;
}

.task-inline-label {
    color: #667085;
    font-size: .78rem;
}

.task-inline-control {
    display: flex;
    align-items: center;
    gap: .4rem;
}

.task-inline-control .form-control,
.task-inline-control .form-select {
    min-width: 0;
    font-weight: 600;
}

.task-inline-value {
    display: block;
    width: 100%;
    min-height: 2rem;
    padding: .15rem 0;
    color: var(--app-text);
    background: transparent;
    border: 0;
    border-bottom: 1px dashed transparent;
    text-align: left;
    font-weight: 700;
    overflow-wrap: anywhere;
}

.task-inline-value:hover,
.task-inline-value:focus {
    border-bottom-color: #98a2b3;
    outline: 0;
}

.task-inline-add-button {
    flex: 0 0 auto;
    width: 2rem;
    height: 2rem;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.task-inline-save-state {
    min-height: 1rem;
    margin-top: .15rem;
    font-size: .74rem;
}

.task-description-block {
    margin-top: .85rem;
}

.overview-important-notes {
    margin-top: .85rem;
}

.overview-section-title {
    margin-bottom: .45rem;
    color: #344054;
    font-size: .86rem;
    font-weight: 700;
}

.overview-note {
    border-left: 3px solid #ffc107;
    padding-left: .65rem;
}

.overview-note + .overview-note {
    margin-top: .65rem;
}

.overview-counts {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: .6rem;
    margin-bottom: .85rem;
}

.overview-counts > div {
    border: 1px solid var(--app-border);
    border-radius: 8px;
    background: #f8fafc;
    padding: .55rem .65rem;
}

.overview-counts span {
    display: block;
    color: #667085;
    font-size: .76rem;
}

.overview-counts strong {
    display: block;
    margin-top: .15rem;
}

.overview-status-group + .overview-status-group {
    margin-top: .35rem;
}

.overview-status-step {
    display: flex;
    align-items: center;
    gap: .55rem;
    width: 100%;
    padding: .25rem 0;
    color: var(--app-text);
    background: transparent;
    border: 0;
    text-align: left;
    font-weight: 600;
}

.overview-status-step:hover {
    color: #0d6efd;
}

.overview-status-dot,
.overview-point-dot {
    width: .9rem;
    height: .9rem;
    border: 2px solid #111827;
    border-radius: 50%;
    flex: 0 0 auto;
}

.overview-status-dot.active,
.overview-point-dot.handled {
    background: #111827;
}

.overview-status-points {
    margin-left: 1.45rem;
}

.overview-point,
.overview-work-point {
    display: flex;
    align-items: center;
    gap: .55rem;
    min-height: 1.65rem;
    color: #344054;
}

.overview-point.handled,
.overview-work-point.handled {
    color: #667085;
}

.overview-work-points {
    margin-left: 0;
    margin-top: .85rem;
}

.overview-work-tree + .overview-work-tree {
    margin-top: .35rem;
}

.overview-work-children {
    margin-left: 1.8rem;
    padding-left: .65rem;
    border-left: 1px dashed var(--app-border);
}

.overview-work-point.is-child {
    font-size: .94rem;
}

.overview-point-toggle {
    display: inline-grid;
    place-items: center;
    width: 1.35rem;
    height: 1.35rem;
    padding: 0;
    color: #111827;
    background: transparent;
    border: 0;
    flex: 0 0 auto;
}

.checkpoint-item,
.work-card-item,
.note-item,
.history-item {
    border: 1px solid var(--app-border);
    border-radius: 8px;
    padding: .9rem;
    background: #fff;
}

.checkpoint-item + .checkpoint-item,
.work-card-item + .work-card-item,
.note-item + .note-item,
.history-item + .history-item {
    margin-top: .75rem;
}

.checkpoint-status-title {
    margin: 1rem 0 .5rem;
    color: #475467;
    font-size: .9rem;
    font-weight: 700;
    text-transform: uppercase;
}

.note-item.important {
    border-color: #ffc107;
    background: #fff9e6;
}

.work-card-summary-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: .75rem;
    border: 1px solid var(--app-border);
    border-radius: 8px;
    background: #f8fafc;
    padding: .85rem;
}

.work-card-summary-grid > div {
    min-width: 0;
}

.work-card-summary-grid span {
    display: block;
    color: #667085;
    font-size: .78rem;
}

.work-card-summary-grid strong {
    display: block;
    margin-top: .15rem;
    overflow-wrap: anywhere;
}

.work-card-progress-summary {
    grid-column: 1 / -1;
}

.work-card-progress-row {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    justify-content: space-between;
    gap: .5rem;
}

.work-card-progress {
    height: .65rem;
    margin-top: .45rem;
    background: #e9eef5;
}

.work-card-item {
    border-left-width: 4px;
}

.work-card-item.handled {
    background: #f8fafc;
}

.work-card-item.is-child {
    margin-left: 1.5rem;
    border-left-style: dashed;
}

.work-card-item-status-not_started {
    border-left-color: #adb5bd;
}

.work-card-item-status-in_progress {
    border-left-color: #0d6efd;
}

.work-card-item-status-completed {
    border-left-color: #198754;
}

.work-card-item-status-not_relevant {
    border-left-color: #6c757d;
}

.work-card-comment {
    border-left: 3px solid #0d6efd;
    padding-left: .75rem;
    color: #344054;
}

.work-card-status-select {
    width: 9.5rem;
}

.work-card-status-actions .btn {
    min-width: 2.2rem;
}

.work-card-status-actions .btn.active {
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .35);
}

.work-card-template-choice {
    display: flex;
    gap: .75rem;
    border: 1px solid var(--app-border);
    border-radius: 8px;
    padding: .8rem;
    cursor: pointer;
}

.work-card-template-choice + .work-card-template-choice {
    margin-top: .65rem;
}

.form-label {
    font-weight: 600;
    color: #344054;
}

.form-control-color {
    width: 4.5rem;
    min-height: 2.4rem;
    padding: .25rem;
}

.admin-actions {
    white-space: nowrap;
}

.admin-actions .btn + .btn {
    margin-left: .25rem;
}

.sort-handle {
    cursor: grab;
    touch-action: none;
}

.sort-cell {
    width: 4.25rem;
    text-align: center;
}

.sort-handle:active {
    cursor: grabbing;
}

.js-sortable-item.sort-dragging {
    opacity: .55;
}

.js-sortable-item.sort-drag-over {
    outline: 2px dashed rgba(13, 110, 253, .45);
    outline-offset: -4px;
}

tr.js-sortable-item.sort-drag-over {
    outline-offset: -2px;
}

.min-w-0 {
    min-width: 0;
}

.template-builder-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr);
    gap: 1rem;
}

.template-builder-panel {
    min-height: 22rem;
    border: 1px solid var(--app-border);
    border-radius: 8px;
    padding: .85rem;
    background: #f8fafc;
}

.template-builder-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .75rem;
    margin-bottom: .75rem;
}

.template-builder-list,
.template-builder-selected {
    display: grid;
    gap: .55rem;
}

.template-builder-available-item,
.template-builder-selected-item {
    background: #fff;
    border: 1px solid var(--app-border);
    border-radius: 8px;
}

.template-builder-available-item {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: .75rem;
    padding: .7rem;
}

.template-builder-available-item.is-selected {
    opacity: .72;
}

.template-builder-selected-row {
    display: flex;
    align-items: flex-start;
    gap: .6rem;
    padding: .7rem;
}

.template-builder-settings {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .55rem .85rem;
    margin-top: .55rem;
}

.template-builder-settings .form-select {
    width: auto;
    min-width: 8.25rem;
}

.template-builder-settings .form-check-label {
    white-space: nowrap;
}

.template-builder-selected-item.is-child {
    margin-left: 2rem;
    background: #fbfdff;
}

.template-builder-handle {
    flex: 0 0 auto;
    cursor: grab;
}

.template-builder-main-drop,
.template-builder-child-drop {
    border: 1px dashed #b8c4d4;
    border-radius: 8px;
    color: #667085;
    background: #fff;
    font-size: .82rem;
    padding: .45rem .6rem;
}

.template-builder-main-drop {
    margin-bottom: .65rem;
    text-align: center;
}

.template-builder-child-drop {
    margin: 0 .7rem .55rem 3.3rem;
}

.template-builder-selected-item.sort-dragging {
    opacity: .55;
}

.template-builder-selected-item.sort-drag-over,
.template-builder-main-drop.sort-drag-over,
.template-builder-child-drop.sort-drag-over {
    outline: 2px dashed rgba(13, 110, 253, .45);
    outline-offset: 2px;
}

.dropdown-menu {
    border-radius: 8px;
}

.modal-xl {
    --bs-modal-width: min(1180px, calc(100vw - 2rem));
}

@media (max-width: 767.98px) {
    .page-heading {
        align-items: stretch !important;
    }

    .page-heading .d-flex {
        width: 100%;
    }

    .page-heading .btn {
        flex: 1;
    }

    .content-panel {
        padding: .85rem;
    }

    .template-builder-grid {
        grid-template-columns: 1fr;
    }

    .template-builder-selected-item.is-child {
        margin-left: .85rem;
    }

    .task-overview-grid,
    .task-overview-fields,
    .task-overview-meta,
    .overview-counts {
        grid-template-columns: 1fr;
    }
}
