/* Extra styling voor de applicatie */
body {
    background-color: #f8f9fa;
}

.navbar {
    margin-bottom: 2rem;
}

.table th {
    background-color: #f8f9fa;
}

.sortable-th {
    cursor: pointer;
    user-select: none;
    position: relative;
    padding-right: 1.75rem; /* ruimte voor sort indicator */
}

.sortable-th:focus {
    outline: 2px solid rgba(13, 110, 253, 0.35);
    outline-offset: -2px;
}

.sortable-th::after {
    content: "↕";
    position: absolute;
    right: 0.5rem;
    top: 50%;
    transform: translateY(-50%);
    opacity: 0.35;
    font-size: 0.85em;
}

.sortable-th.is-sorted-asc::after {
    content: "▲";
    opacity: 0.75;
}

.sortable-th.is-sorted-desc::after {
    content: "▼";
    opacity: 0.75;
}

.filterable-th {
    vertical-align: top;
}

.filterable-th.sortable-th {
    padding-right: 0.5rem;
}

.filterable-th.sortable-th::after {
    display: none; /* pijl zit op .th-sort-label */
}

.th-sort-label.sortable-th {
    display: inline-block;
    padding-right: 1.5rem;
}

.th-label {
    display: inline-block;
}

.filterable-th .th-filter {
    display: block;
    width: 100%;
    margin-top: 0.35rem;
    font-weight: 400;
    min-width: 5.5rem;
}

.btn {
    margin-right: 0.5rem;
}

/* Form styling */
.form-control:focus {
    border-color: #80bdff;
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
}

/* Responsive table */
@media (max-width: 768px) {
    .table-responsive {
        font-size: 0.9rem;
    }
}

/* Huurder facturen / sleep-match */
.huurder-facturen-header-select {
    max-width: 18rem;
    min-width: 10rem;
}

.filter-toggle {
    flex-shrink: 0;
}

.filter-panel.is-collapsed {
    display: none;
}

.filter-toggle[aria-expanded="false"] .filter-toggle-chevron {
    transform: rotate(180deg);
}

.filter-toggle-chevron {
    display: inline-block;
    transition: transform 0.15s ease;
}

.match-board {
    min-height: 12rem;
}

.match-align {
    min-height: 8rem;
}

.match-pair {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.75rem;
    margin-bottom: 0.5rem;
    align-items: stretch;
}

@media (min-width: 992px) {
    .match-pair {
        grid-template-columns: 1fr 1fr;
        gap: 1rem;
    }

    .match-pair.is-paired {
        grid-template-columns: 1fr auto 1fr;
    }

    .match-slide-plus {
        display: none;
    }

    .match-slide-arrow {
        display: inline-block;
    }
}

.match-pair.is-paired {
    background: rgba(25, 135, 84, 0.06);
    border-radius: 0.5rem;
    padding: 0.4rem;
}

.match-slide-wrap {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.15rem 0;
}

.match-slide-btn {
    width: 2.35rem;
    height: 2.35rem;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: #198754;
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    line-height: 1;
    cursor: pointer;
    box-shadow: 0 0 0 3px rgba(25, 135, 84, 0.22);
}

.match-slide-btn:hover,
.match-slide-btn:focus-visible {
    background: #157347;
    outline: none;
}

.match-slide-plus {
    font-weight: 700;
}

.match-slide-arrow {
    display: none;
    font-size: 1.15rem;
}

.match-pair-col {
    min-width: 0;
}

.match-spacer {
    height: 100%;
    min-height: 4.5rem;
    border: 1px dashed #dee2e6;
    border-radius: 0.375rem;
    background-color: #f8f9fa;
}

.match-card {
    cursor: grab;
    border: 1px solid #dee2e6;
    height: 100%;
    transition: box-shadow 0.15s ease, border-color 0.15s ease, background-color 0.15s ease;
}

.match-card:hover {
    box-shadow: 0 0.25rem 0.6rem rgba(0, 0, 0, 0.08);
}

.match-card.is-selected {
    border-color: #0d6efd;
    box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.25);
}

.match-card.is-drag-over {
    border-color: #198754;
    background-color: #f0fff4;
}

.match-card.is-dragging {
    opacity: 0.45;
}

.match-card:not(.is-matchable) {
    cursor: default;
    opacity: 0.72;
}

.match-card.is-likely {
    border-color: #198754;
    background-color: #f6fff8;
}

.match-card .suggest-badge {
    display: inline-flex;
    flex-wrap: wrap;
    gap: 0.2rem;
    vertical-align: middle;
}

.match-card .suggest-badge .badge {
    font-weight: 500;
}

.match-queue {
    margin-bottom: 0.75rem;
    padding-bottom: 0.75rem;
    border-bottom: 2px solid #198754;
}

.match-queue-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
    margin-bottom: 0.75rem;
}

.match-queue-item {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.75rem;
    align-items: stretch;
    margin-bottom: 0.5rem;
    padding: 0.4rem;
    background: rgba(25, 135, 84, 0.08);
    border-radius: 0.5rem;
}

@media (min-width: 768px) {
    .match-queue-item {
        grid-template-columns: 1fr 1fr auto;
        gap: 1rem;
    }
}

.match-queue-item:last-child {
    margin-bottom: 0;
}

.match-queue-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
}

.match-dot {
    flex: 0 0 auto;
    width: 1.6rem;
    height: 1.6rem;
    margin-top: 0.15rem;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: #198754;
    color: #fff;
    font-size: 0.75rem;
    font-weight: 700;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 0 0 2px #fff, 0 0 0 3px rgba(25, 135, 84, 0.35);
}

.match-dot:hover,
.match-dot[aria-expanded="true"] {
    background: #157347;
    box-shadow: 0 0 0 2px #fff, 0 0 0 4px rgba(25, 135, 84, 0.45);
}

.match-dot-count {
    pointer-events: none;
}

.match-dot-menu {
    position: fixed;
    z-index: 1080;
    width: 20rem;
    max-width: calc(100vw - 1rem);
    max-height: min(22rem, calc(100vh - 1rem));
    overflow: auto;
    padding: 0.4rem;
    background: #fff;
    border: 1px solid #dee2e6;
    border-radius: 0.5rem;
    box-shadow: 0 0.5rem 1.25rem rgba(0, 0, 0, 0.18);
}

.match-dot-menu-title {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: #6c757d;
    padding: 0.35rem 0.55rem 0.45rem;
}

.match-dot-option {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    width: 100%;
    text-align: left;
    border: 0;
    border-radius: 0.375rem;
    background: transparent;
    padding: 0.5rem 0.55rem;
    cursor: pointer;
}

.match-dot-option:hover,
.match-dot-option:focus-visible {
    background: #f6fff8;
    outline: none;
}

.match-dot-option-main {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 0.75rem;
}

.match-dot-option-meta {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    font-size: 0.8rem;
}

.match-dot-option-redenen {
    display: flex;
    flex-wrap: wrap;
    gap: 0.2rem;
}

.afletter-hint {
    border: 1px solid #badbcc;
    background: #f6fff8;
    border-radius: 0.5rem;
    padding: 0.75rem 1rem;
}

.afletter-hint[hidden] {
    display: none !important;
}

.afletter-hint-dropdown {
    width: 100%;
    max-width: 36rem;
}

.afletter-hint-toggle {
    cursor: pointer;
    height: auto;
    min-height: calc(1.5em + 0.5rem + 2px);
    white-space: normal;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    justify-content: center;
    gap: 0.05rem;
}

.afletter-hint-redenen {
    display: flex;
    flex-wrap: wrap;
    gap: 0.2rem;
}

.afletter-hint-menu {
    width: 100%;
    max-height: 18rem;
    overflow: auto;
}

.afletter-hint-option {
    display: flex;
    align-items: flex-start;
    gap: 0.55rem;
    margin: 0;
    padding: 0.45rem 0.65rem;
    cursor: pointer;
    white-space: normal;
}

.afletter-hint-option + .afletter-hint-option {
    border-top: 1px solid #eef2ef;
}

.afletter-hint-option:hover,
.afletter-hint-option.is-likely {
    background: #f6fff8;
}

.afletter-hint-option-body {
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
    min-width: 0;
    flex: 1;
}

.afletter-hint-check {
    margin-top: 0.2rem;
}

.grootboek-ai-suggest {
    margin-top: 0.25rem;
    font-size: 0.8rem;
    line-height: 1.25;
}

.grootboek-ai-suggest[hidden] {
    display: none !important;
}

.grootboek-ai-suggest-btn {
    color: #0d6efd;
    text-decoration: underline;
    text-underline-offset: 0.15em;
}

.grootboek-ai-suggest-btn:hover,
.grootboek-ai-suggest-btn:focus {
    color: #0a58ca;
}

.afletter-dots {
    display: inline-flex;
    align-items: center;
    gap: 0.2rem;
    flex-shrink: 0;
    text-decoration: none;
}

.afletter-dot {
    min-width: 1.35rem;
    height: 1.35rem;
    padding: 0 0.28rem;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    font-weight: 700;
    line-height: 1;
    color: #fff;
}

.afletter-dot-factuur {
    background: #fd7e14;
}

.afletter-dot-bank {
    background: #0d6efd;
}

.afletter-dot.is-zero {
    background: #adb5bd;
}

.afletter-dots:hover .afletter-dot-factuur {
    background: #e36b00;
}

.afletter-dots:hover .afletter-dot-bank {
    background: #0b5ed7;
}

.afletter-dots:hover .afletter-dot.is-zero {
    background: #8e959b;
}

.bulk-factuur-hint {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.2rem;
}

.bulk-factuur-badge {
    white-space: normal;
    text-align: left;
} 