:root {
    --main-color: #2ecc71;
    --main-color-light: #27ae60;
    --main-color-lighter: #7ee9ae;
    --main-color-dark: #229954;
    --main-color-darker: #1e8449;
    --text-primary: #1f2937;
    --text-muted: #6b7280;
    --surface: #ffffff;
    --surface-soft: #f8fafc;
    --border-color: #e5e7eb;
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.06);
    --shadow-md: 0 8px 24px rgba(15, 23, 42, 0.08);
    --shadow-lg: 0 14px 34px rgba(15, 23, 42, 0.12);
    --transition-fast: 150ms ease;
    --transition-base: 220ms ease;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    overflow: auto;
    background: radial-gradient(circle at top right, #f0fff7 0%, #f8fafc 35%, #f5f7fa 100%);
    color: var(--text-primary);
}

html, body, main {
    height: calc(100vh - 70px);
    font-weight: 300 !important;
    overflow: hidden;
}

main {
    position: relative;
}

#page-info > h1 {
    color: var(--main-color);
    font-weight: 300 !important;
    font-size: 2rem !important;
    letter-spacing: 0.04em;
}

#page-info > p {
    opacity: 0.8;
    color: var(--text-muted);
}

p,
.text-muted,
small {
    color: var(--text-muted) !important;
}

.navbar-brand { margin-left: 20px; }

#mobile-topbar-actions {
    margin-left: 0.5rem;
    margin-right: auto;
}

#mobile-topbar-actions-content {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

#mobile-topbar-actions-content .btn,
#mobile-topbar-actions-content a.btn {
    min-height: 36px;
    padding: 6px 10px;
    border-radius: 999px;
    font-size: 0.85rem;
    line-height: 1.1;
    white-space: nowrap;
}

#mobile-topbar-actions-content .btn svg,
#mobile-topbar-actions-content a.btn svg {
    width: 16px;
    height: 16px;
}

#mobile-topbar-actions-content .btn .text,
#mobile-topbar-actions-content a.btn .text {
    display: inline-block;
    max-width: 120px;
    overflow: hidden;
    text-overflow: ellipsis;
    vertical-align: bottom;
}

#content-container {
    height: 100%;
    overflow-y: auto;
    padding-top: 1.25rem;
    padding-bottom: 150px !important;
}

#content-container::-webkit-scrollbar {
    width: 10px;
}

#content-container::-webkit-scrollbar-thumb {
    background-color: #d1d5db;
    border-radius: 999px;
    border: 2px solid transparent;
    background-clip: content-box;
}

a, a.default {
    text-decoration: none;
    color: var(--main-color);
    transition: color var(--transition-fast), opacity var(--transition-fast);
}

a:hover, a.default:hover {
    color: var(--main-color-light);
}

a:focus-visible,
.btn:focus-visible,
.form-control:focus-visible,
.form-select:focus-visible,
.page-link:focus-visible,
.dropdown-item:focus-visible {
    outline: 0;
    box-shadow: 0 0 0 3px rgba(46, 204, 113, 0.25) !important;
}

.hidden {
    display: none !important;
}

.text-main-color {
    color: var(--main-color);
}

.fixed-text-wrapper {
    position: relative;
    height: 220px;
    overflow: hidden;
}

.partial-text-wrapper {
    position: relative;
    transition: max-height 0.3s ease-out;
    max-height: 220px;
    overflow: hidden;
}

.partial-text-wrapper.expanded {
    max-height: 4000px;
    transition: max-height 0.6s ease-in;
}

.partial-text {
    margin-bottom: 0;
}

.navbar {
    position: relative;
    z-index: 1060;
    background-color: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(8px);
    border-bottom: 1px solid rgba(229, 231, 235, 0.8);
    box-shadow: var(--shadow-sm);
}

header {
    position: relative;
    z-index: 9;
}

.navbar .dropdown-menu {
    z-index: 1070;
}

.monogram-logo {
    display: inline-block;
    width: 32px;
    height: 32px;
    line-height: 32px;
    border-radius: 50%;
    background-color: var(--main-color);
    color: #fff;
    text-align: center;
    font-size: 18px;
    text-transform: capitalize;
    font-weight: 400;
    box-shadow: 0 8px 20px rgba(46, 204, 113, 0.28);
}

#btn-add-new {
    display: block;
    position: fixed;
    top: auto;
    bottom: 50px;
    left: auto;
    right: 50px;
    background-color: var(--main-color);
    color: #fff;
    font-weight: 600;
    font-size: 28px;
    width: 50px;
    height: 50px;
    text-align: center;
    line-height: 50px;
    border-radius: 50%;
    cursor: pointer;
    box-shadow: var(--shadow-lg);
    transition: transform var(--transition-base), background-color var(--transition-base), box-shadow var(--transition-base);
}

#btn-add-new:hover {
    background-color: var(--main-color-light);
    transform: translateY(-2px);
    box-shadow: 0 18px 34px rgba(39, 174, 96, 0.35);
}

.card {
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    background-color: var(--surface);
    box-shadow: var(--shadow-sm);
    transition: transform var(--transition-base), box-shadow var(--transition-base), border-color var(--transition-base);
}

.card:hover {
    border-color: #d1d5db;
    box-shadow: var(--shadow-md);
}

.card .card-header,
.card .card-footer {
    background-color: transparent;
    border-color: var(--border-color);
}

.card-title {
    color: var(--main-color);
    font-weight: 300 !important;
    letter-spacing: 0.01em;
}

/* A 255-character item name grew its card to five times the normal height and
   pushed every card below it off the screen. Two lines, then an ellipsis; the
   full name lives in the element's title attribute. */
.card-title--clamp {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    line-clamp: 2;
    overflow: hidden;
    overflow-wrap: anywhere;
}

.alert-container {
    position: fixed;
    top: 70px;
    right: 20px;
    z-index: 99999;
    width: 100%;
    max-width: 340px;
}

/* Messages wrap instead of being clipped. The container is narrow, and the
   longest messages are the ones carrying the limit and the count — exactly
   the part worth reading. This also neutralises `text-truncate` if a future
   caller adds it back. */
.alert-container .alert {
    white-space: normal;
    overflow: visible;
    text-overflow: clip;
    overflow-wrap: anywhere;
}

.alert {
    border-radius: var(--radius-md);
    border-width: 1px;
    box-shadow: var(--shadow-sm);
}

.shadow-sm {
    --tw-shadow: 0 1px 2px 0 rgb(0 0 0 / .05);
    --tw-shadow-colored: 0 1px 2px 0 var(--tw-shadow-color);
    box-shadow: var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow);
}

/* Bootstrap overrides */
.btn {
    border-radius: 10px;
    font-weight: 500;
    transition: all var(--transition-fast);
    border: 1px solid transparent;
}

.btn:hover {
    transform: translateY(-1px);
}

.btn:active {
    transform: translateY(0);
}

.btn-no-border {
    border-width: 0;
}

.active>.page-link, .page-link.active {
    border: 1px solid var(--main-color);
}

.btn-primary, .active>.page-link, .page-link.active {
    background-color: var(--main-color);
    border-color: var(--main-color);
    color: #fff;
}

.btn-outline-primary {
    color: var(--main-color);
    border-color: var(--main-color);
    background-color: transparent;
}

.btn-light {
    background-color: #f3f4f6;
    border-color: #f3f4f6;
    color: #374151;
}

.btn-light:hover {
    background-color: #e5e7eb;
    border-color: #e5e7eb;
    color: #111827;
}

.btn-primary:hover, .btn-outline-primary:hover, .btn-secondary:hover {
    background-color: var(--main-color-light);
    border-color: var(--main-color-light);
    color: #fff;
}
.btn:disabled.btn-primary, .btn:disabled.btn-primary:hover {
    background-color: var(--main-color-lighter);
    border-color: var(--main-color-lighter);
    cursor: not-allowed;
}
.btn:disabled.btn-outline-primary, .btn:disabled.btn-outline-primary:hover {
    color: var(--main-color-lighter);
    cursor: not-allowed;
}

.btn-secondary {
    background-color: #eceff3;
    border-color: #eceff3;
    color: #424242;
}

.btn:disabled.btn-primary, .btn:disabled.btn-primary:hover {
    color: #858585;
    cursor: not-allowed;
}

.form-control,
.form-select,
.input-group-text {
    border-radius: 10px;
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    background-color: #fff;
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.form-control::placeholder {
    color: #9ca3af;
}

.form-control:focus,
.form-select:focus {
    border-color: var(--main-color);
    box-shadow: 0 0 0 3px rgba(46, 204, 113, 0.16);
}

.table {
    --bs-table-bg: transparent;
    margin-bottom: 0;
}

.table > :not(caption) > * > * {
    border-bottom-color: #edf0f4;
    padding-top: 0.8rem;
    padding-bottom: 0.8rem;
    vertical-align: middle;
}

.table-hover > tbody > tr:hover > * {
    background-color: rgba(46, 204, 113, 0.06);
    color: inherit;
}

.badge {
    font-weight: 500;
    border-radius: 999px;
    padding: 0.38rem 0.62rem;
}

.dropdown-menu {
    border: 1px solid var(--border-color);
    border-radius: 12px;
    box-shadow: var(--shadow-md);
    padding: 0.35rem;
}

.dropdown-item {
    border-radius: 8px;
    padding: 0.5rem 0.75rem;
}

.dropdown-item:hover,
.dropdown-item:focus {
    background-color: rgba(46, 204, 113, 0.1);
    color: var(--main-color-darker);
}

.page-link {
    color: var(--main-color-dark);
    border-radius: 8px;
    border-color: var(--border-color);
    margin: 0 2px;
}

.page-link:hover {
    color: #fff;
    background-color: var(--main-color-light);
    border-color: var(--main-color-light);
}

.pagination-modern-wrap {
    width: 100%;
}

.pagination.pagination-modern {
    gap: 6px;
    margin-bottom: 0;
    flex-wrap: wrap;
}

.pagination.pagination-modern .page-item .page-link {
    min-width: 40px;
    height: 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    border: 1px solid var(--border-color);
    background: #fff;
    color: #334155;
    font-weight: 500;
    padding: 0 12px;
    transition: all var(--transition-fast);
    box-shadow: 0 1px 1px rgba(15, 23, 42, 0.03);
}

.pagination.pagination-modern .page-item:not(.disabled):not(.active) .page-link:hover {
    background: rgba(46, 204, 113, 0.1);
    border-color: rgba(46, 204, 113, 0.38);
    color: var(--main-color-darker);
}

.pagination.pagination-modern .page-item.active .page-link,
.pagination.pagination-modern .active > .page-link {
    background: var(--main-color);
    border-color: var(--main-color);
    color: #fff;
    box-shadow: 0 6px 14px rgba(46, 204, 113, 0.3);
}

@media (min-width: 768px) {
    .items-list-pagination-wrap .pagination.pagination-modern {
        justify-content: center !important;
    }
}

.pagination.pagination-modern .page-item.disabled .page-link {
    color: #94a3b8;
    background: #f8fafc;
    border-color: #e5e7eb;
    opacity: 1;
}

.modal-content {
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
}

hr {
    opacity: 1;
    border-top: 1px solid #edf0f4;
}

.catalog-icon {
    width: 50px;
}
.catalog-icon svg {
    width: 100%;
    height: auto;
    color: var(--main-color);
}

#sidebar {
    background-color: #ffffff;
    border-right: 1px solid var(--border-color);
}

#sidebar .nav-link {
    text-decoration: none;
    color: var(--main-color-dark);
    border-radius: 10px;
    font-weight: 300 !important;
    transition: all var(--transition-fast);
}

#sidebar .nav-link:hover {
    background-color: rgba(46, 204, 113, 0.1);
    color: var(--main-color-darker);
}

#sidebar .nav-link.active,
#sidebar .nav-link[aria-current="page"] {
    background-color: rgba(46, 204, 113, 0.14);
    color: var(--main-color-darker);
    font-weight: 500 !important;
}

/* History page (mobile-first) */
.history-actions {
    width: 100%;
}

.history-actions .btn {
    width: 100%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.history-list {
    position: relative;
    display: grid;
    gap: 10px;
}

.history-list::before {
    content: "";
    position: absolute;
    left: 21px;
    top: 8px;
    bottom: 8px;
    width: 2px;
    background-color: #d9e2ec;
}

.history-entry {
    position: relative;
    display: grid;
    grid-template-columns: 44px minmax(0, 1fr);
    align-items: start;
    gap: 0;
}

.history-line-node-wrap {
    position: relative;
    display: flex;
    justify-content: center;
    padding-top: 10px;
    z-index: 1;
}

.history-line-node {
    width: 40px;
    height: 40px;
    border-radius: 999px;
    color: #fff;
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-sm);
    border: 2px solid #fff;
}

.history-card {
    border-radius: var(--radius-md);
    overflow: hidden;
}

.history-card .card-body {
    padding: 14px;
}

.history-header {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 12px;
}

.history-actor {
    display: flex;
    align-items: flex-start;
}

.history-meta {
    min-width: 0;
}

.history-user,
.history-date {
    display: flex;
    align-items: center;
    gap: 2px;
    word-break: break-word;
}

.history-user {
    color: var(--text-primary);
    font-weight: 500;
    margin-bottom: 2px;
}

.history-date {
    color: var(--text-muted);
    font-size: 0.9rem;
}

.history-badge-wrap {
    width: 100%;
}

.history-badge {
    background-color: rgba(46, 204, 113, 0.12) !important;
    color: var(--main-color-darker);
    border: 1px solid rgba(46, 204, 113, 0.25);
    width: 100%;
    text-align: left;
    display: inline-flex;
    align-items: center;
    justify-content: flex-start;
    padding: 8px 10px;
    white-space: normal;
}

.history-changes {
    border-top: 1px solid #edf0f4;
    padding-top: 10px;
}

.history-change-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: grid;
    gap: 6px;
}

.history-change-list li {
    background-color: var(--surface-soft);
    border: 1px solid #edf0f4;
    border-radius: var(--radius-sm);
    padding: 6px 8px;
    display: grid;
    grid-template-columns: minmax(90px, 26%) minmax(0, 1fr);
    align-items: center;
    gap: 8px;
}

.history-field {
    display: inline-block;
    font-weight: 600;
    color: #374151;
    margin-bottom: 0;
    font-size: 0.82rem;
    line-height: 1.1;
    /* No text-transform: the label is a Dutch verbose_name, already
       sentence-cased. Capitalising turned "Wacht op bevestiging door
       gebruiker" into Title Case (and "processing_message" into
       "Processing_message" before that). */
}

.history-change-values {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-wrap: wrap;
}

.history-old,
.history-new {
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    font-size: 0.78rem;
    line-height: 1.2;
    padding: 2px 7px;
    border: 1px solid transparent;
    max-width: 100%;
    overflow-wrap: anywhere;
}

.history-old {
    background-color: #fef2f2;
    border-color: #fecaca;
    color: #b91c1c;
}

.history-new {
    background-color: #ecfdf5;
    border-color: #a7f3d0;
    color: #047857;
}

.history-arrow {
    color: #9ca3af;
    width: 14px;
    height: 14px;
    flex-shrink: 0;
}

/* Items */
.processing-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(3px);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 10;
    border-radius: inherit;
}
.processing-overlay .spinner-border {
    width: 3rem;
    height: 3rem;
}
.item-card-wrapper {
    position: relative;
}

/* Mobile-first item card cleanup */
.mobile-item-image {
    height: 170px;
    object-fit: cover;
}

.mobile-item-title {
    margin: 0;
    font-size: 1.5rem;
    line-height: 1.25;
}

.mobile-item-title a {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    max-width: 100%;
    white-space: pre-wrap;
}

.mobile-title-edit-icon {
    width: 14px;
    height: 14px;
    opacity: 0.75;
    flex-shrink: 0;
}

.mobile-item-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.65rem;
    margin-top: 0.35rem;
}

/* Item edit form: Terug / Opslaan stay on screen while scrolling on mobile
   (Tom, 11-10). Sticky, not fixed: it stays in the form's flow, so nothing
   is hidden behind it and it behaves with the iPhone keyboard. */
@media screen and (max-width: 768px) {
    .form-actions-sticky {
        position: sticky;
        bottom: 0;
        z-index: 1030;
        background: var(--bs-body-bg);
        border-top: 1px solid var(--bs-border-color);
        padding: 0.75rem 0 calc(0.75rem + env(safe-area-inset-bottom));
    }

    /* The processing pill sits bottom-left; lift it above the bar. */
    body:has(.form-actions-sticky) #mobile-processing-widget {
        bottom: calc(90px + env(safe-area-inset-bottom)) !important;
    }
}

/* A long location path ends in "…" instead of widening the card (1116). */
.mobile-item-meta .item-location-path {
    min-width: 0;
    max-width: 100%;
}

.mobile-item-kpis {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-top: 12px;
}

.mobile-kpi {
    border: 1px solid #edf0f4;
    background-color: #f8fafc;
    border-radius: 10px;
    padding: 8px;
}

.mobile-kpi-label {
    display: block;
    font-size: 0.72rem;
    color: #6b7280;
    margin-bottom: 3px;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.mobile-item-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: nowrap;
    gap: 8px;
    margin-top: 12px;
}

.mobile-icon-btn {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    width: 60px;
    height: 60px;
    flex: 0 0 48px;
    padding: 0;
    position: relative;
    border-radius: 10px;
}

.mobile-icon-btn i,
.mobile-icon-btn svg {
    width: 40px;
    height: 40px;
}

.mobile-icon-btn .comment-count-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    min-width: 20px;
    height: 20px;
    font-size: 0.68rem;
    line-height: 1;
    padding: 0.25rem 0.35rem;
}

.mobile-icon-btn.btn-outline-secondary.text-warning {
    border-color: #f4d98f;
}

/* Proof-of-purchase row on the mobile item card: one full-width control
   above the action buttons, in one of three states (upload / pending /
   linked). Owner request 2026-09-11 — the icon-only button was missed. */
.mobile-proof-row {
    margin-top: 12px;
}

.mobile-proof-btn,
.mobile-proof-link,
.mobile-proof-delete {
    height: 48px;
    border-radius: 10px;
}

.mobile-proof-btn {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-weight: 500;
}

.mobile-proof-btn svg,
.mobile-proof-link svg,
.mobile-proof-delete svg {
    width: 22px;
    height: 22px;
    flex: 0 0 auto;
}

.mobile-proof-linked {
    display: flex;
    width: 100%;
}

/* Owner feedback 2026-09-11: outline buttons on the phone need a visible
   edge. The shorthand deliberately drops border-color so it follows the
   button's own text colour (currentColor). */
.mobile-proof-btn.btn-outline-danger,
.mobile-proof-link,
.mobile-proof-delete {
    border: 2px solid;
}

/* Receipt link + delete as one control (desktop and mobile): only the
   delete button draws the border between the two. The :not(:last-child)
   keeps the link's border when no delete button follows (role without
   receipt permission). */
.proof-group > .btn:first-child:not(:last-child) {
    border-right-width: 0;
}

.proof-group > .btn + .btn {
    margin-left: 0;
}

.mobile-proof-linked + .mobile-proof-linked {
    margin-top: 8px;
}

.mobile-proof-link {
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 8px;
    text-align: left;
}

.mobile-proof-link .text-truncate {
    min-width: 0;
}

.mobile-proof-delete {
    flex: 0 0 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}

.items-stats-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
}

.items-stats-card {
    border-radius: var(--radius-md);
    border: 1px solid #e9eef5;
    background: linear-gradient(180deg, #ffffff 0%, #fbfdff 100%);
}

.items-stats-card .card-body {
    padding: 14px;
}

.items-stats-card-desktop .card-body {
    display: flex;
    align-items: center;
    gap: 12px;
}

.items-stats-content {
    min-width: 0;
}

.items-stats-icon-wrap {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    background: rgba(46, 204, 113, 0.12);
    color: var(--main-color-dark);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.items-stats-icon {
    width: 20px;
    height: 20px;
    color: var(--main-color-dark);
}

.items-stats-label {
    margin: 0;
    color: #64748b !important;
    font-size: 0.78rem;
    font-weight: 500;
    letter-spacing: 0.02em;
    text-transform: uppercase;
}

.items-stats-value {
    color: #0f172a;
    font-size: 1.15rem;
    font-weight: 700;
    line-height: 1.2;
}

.items-stats-link {
    display: inline-block;
    margin-top: 4px;
    font-size: 0.82rem;
    font-weight: 500;
}

.items-stats-grid-mobile .items-stats-card-mobile .card-body {
    text-align: center;
    padding: 12px 8px;
}

.items-stats-grid-mobile .items-stats-icon-wrap {
    margin: 0 auto 8px auto;
    width: 36px;
    height: 36px;
    border-radius: 10px;
}

.items-stats-grid-mobile .items-stats-icon {
    width: 18px;
    height: 18px;
}

.items-stats-grid-mobile .items-stats-label {
    font-size: 0.7rem;
}

.items-stats-grid-mobile .items-stats-value {
    font-size: 1rem;
}

#items-alert {
    position: fixed;
    top: 84px;
    right: 16px;
    left: auto;
    z-index: 1085;
    width: auto;
    max-width: min(420px, calc(100vw - 32px));
    margin: 0;
    box-shadow: 0 12px 30px rgba(15, 23, 42, 0.18);
    border-radius: 12px;
}

@media screen and (max-width: 767px) {
    #items-alert {
        top: 70px;
        left: 0;
        right: 0;
        width: 100%;
        max-width: none;
        border-radius: 0;
    }
}

/* Mobile page actions FAB (Google Paper style) */
#mobile-page-actions {
    position: fixed;
    right: 16px;
    bottom: 20px;
    z-index: 1100;
}

#mobile-page-actions-hint {
    position: absolute;
    right: 64px;
    bottom: 10px;
    background: #ffffff;
    color: #334155;
    border: 1px solid var(--border-color);
    border-radius: 999px;
    font-size: 0.78rem;
    font-weight: 600;
    letter-spacing: 0.01em;
    line-height: 1;
    padding: 7px 10px;
    box-shadow: var(--shadow-md);
    white-space: nowrap;
    pointer-events: none;
    transition: opacity var(--transition-fast), transform var(--transition-fast);
}

#mobile-page-actions-fab {
    width: 56px;
    height: 56px;
    border-radius: 999px;
    background-color: var(--main-color);
    color: #fff;
    border: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 12px 28px rgba(15, 23, 42, 0.32);
    transition: transform var(--transition-base), box-shadow var(--transition-base), background-color var(--transition-base);
    animation: mobile-fab-pulse 2.2s infinite;
}

@keyframes mobile-fab-pulse {
    0%, 100% {
        box-shadow: 0 12px 28px rgba(15, 23, 42, 0.32), 0 0 0 0 rgba(46, 204, 113, 0.38);
    }
    60% {
        box-shadow: 0 12px 28px rgba(15, 23, 42, 0.32), 0 0 0 12px rgba(46, 204, 113, 0);
    }
}

#mobile-page-actions-fab:hover {
    background-color: var(--main-color-light);
}

#mobile-page-actions.is-open #mobile-page-actions-fab {
    transform: rotate(45deg);
    animation: none;
}

#mobile-page-actions.is-open #mobile-page-actions-hint {
    opacity: 0;
    transform: translateY(6px);
}

#mobile-page-actions-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.24);
    backdrop-filter: blur(1px);
}

#mobile-page-actions-menu {
    position: absolute;
    right: 0;
    bottom: 68px;
    width: min(320px, calc(100vw - 32px));
    background: #fff;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    padding: 10px;
}

#mobile-page-actions-content {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

#mobile-page-actions-content .btn,
#mobile-page-actions-content a.btn {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    text-align: left;
    padding: 10px 12px;
    /* Clones keep their desktop spacing classes (me-2/ms-2); inside the
       stacked menu those margins skew the column. Bootstrap's spacing
       utilities are !important, so this must be too. */
    margin: 0 !important;
}

#mobile-page-actions-content .btn-group {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

#mobile-page-actions-content .dropdown,
#mobile-page-actions-content .dropdown > .btn {
    width: 100%;
}

#mobile-page-actions-content .text-end {
    text-align: left !important;
}

@media screen and (min-width: 768px) {
    /* history */
    .history-actions {
        width: auto;
    }

    .history-actions .btn {
        width: auto;
        justify-content: center;
    }

    .history-card .card-body {
        padding: 18px;
    }

    .history-line-node-wrap {
        padding-top: 12px;
    }

    .history-header {
        flex-direction: row;
        justify-content: space-between;
        align-items: flex-start;
    }

    .history-badge-wrap {
        width: auto;
        max-width: 48%;
    }

    .history-badge {
        width: auto;
        text-align: left;
    }

    .history-change-list li {
        padding: 7px 10px;
        grid-template-columns: minmax(120px, 22%) minmax(0, 1fr);
    }

    /* Items */
    .mobile-item-image {
        height: 180px;
    }

    .items-stats-grid {
        gap: 14px;
    }

    .items-stats-card .card-body {
        padding: 16px;
    }

    .items-stats-value {
        font-size: 1.25rem;
    }
}

@media screen and (max-width: 768px) {
    /* Make mobile scrolling natural (avoid scroll traps). */
    html, body {
        height: auto !important;
        overflow: auto !important;
    }

    main {
        height: auto !important;
        overflow: visible !important;
    }

    /* Content padding tuned for small screens and thumb use. */
    #content-container {
        height: auto !important;
        overflow: visible !important;
        padding: 1rem !important;
        padding-bottom: 120px !important;
    }

    /* Larger touch targets (minimum 44px). */
    .btn,
    .form-control,
    .form-select,
    .dropdown-item,
    .nav-link {
        min-height: 44px;
    }

    /* Prevent iOS zoom-on-focus by keeping input font-size >= 16px. */
    .form-control,
    .form-select,
    .input-group-text,
    .btn {
        font-size: 16px;
    }

    .btn {
        padding: 10px 14px;
    }

    /* Make btn-sm still usable on mobile. */
    .btn.btn-sm {
        font-size: 16px;
        padding: 10px 14px;
    }

    .card {
        border-radius: 10px;
        box-shadow: var(--shadow-sm);
    }

    .dropdown-menu .dropdown-item {
        padding: 12px 14px;
    }

    /* Alerts should not cover too much screen on mobile. */
    .alert-container {
        left: 12px;
        right: 12px;
        top: 70px;
        max-width: none;
    }

    /* Floating add button: slightly larger and closer to thumb reach. */
    #btn-add-new {
        bottom: 24px;
        right: 16px;
        width: 56px;
        height: 56px;
        line-height: 56px;
        font-size: 30px;
    }

    /* Page actions should wrap cleanly on mobile instead of shrinking text. */
    #page-actions {
        display: none;
    }

    #page-actions > div {
        display: flex;
        flex-wrap: wrap;
        gap: 10px;
        justify-content: flex-start;
        margin-bottom: 20px;
    }

    #page-actions svg {
        width: 20px;
        height: 20px;
    }

    /* Icon-only buttons (three-dots etc.) */
    .btn-icon-touch {
        width: 44px;
        height: 44px;
        padding: 0;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        border-radius: 999px;
    }

    .table-responsive {
        border-radius: var(--radius-md);
        border: 1px solid var(--border-color);
        background-color: #fff;
    }

    .pagination.pagination-modern {
        justify-content: center;
    }

    .items-stats-grid {
        gap: 8px;
    }

    .items-stats-grid-mobile .items-stats-card-mobile .card-body {
        padding: 10px 6px;
    }

    .items-stats-grid-mobile .items-stats-icon-wrap {
        width: 34px;
        height: 34px;
        margin-bottom: 6px;
    }

    .items-stats-grid-mobile .items-stats-value {
        font-size: 0.95rem;
    }

    #mobile-page-actions {
        right: 16px;
        bottom: 20px;
    }

    #mobile-page-actions-hint {
        right: 62px;
        bottom: 8px;
    }

    #mobile-topbar-actions {
        display: flex;
        flex-direction: row;
        justify-content: start;
        align-items: center;
        margin-left: 5px;
        margin-right: auto;
    }

    #mobile-topbar-actions-content .btn,
    #mobile-topbar-actions-content a.btn {
        min-height: 34px;
        padding: 5px;
        font-size: 1.2rem;
    }

    #mobile-topbar-actions-content .btn .text,
    #mobile-topbar-actions-content a.btn .text {
        max-width: 90px;
    }
}

/* ============================================================
   Comments modal (items_list.html)
   ============================================================ */
#item-comments-modal {
    z-index: 1200;
}

.comments-modal-backdrop {
    z-index: 1195;
}

/* ============================================================
   Form fieldsets (item_detail.html, item_create.html)
   ============================================================ */
fieldset {
    margin-bottom: 2rem;
}

/* ============================================================
   Catalog form processing overlay (catalog_form.html)
   Note: .processing-overlay and .item-card-wrapper are already
   defined in the main CSS above from inline_styles.html.
   This variant uses inset shorthand and bs-body-bg-rgb.
   ============================================================ */
.catalog-form-processing-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(var(--bs-body-bg-rgb), 0.75);
    z-index: 10;
    cursor: progress;
}

/* ============================================================
   Export spreadsheet table (export_catalogs.html, export_items.html)
   ============================================================ */
.export-page-wrapper .container {
    max-width: 100%;
    padding-left: 1rem;
    padding-right: 1rem;
}

.spreadsheet-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
    table-layout: fixed;
}
.spreadsheet-table thead th {
    background: #f8f9fa;
    border: 1px solid #d0d5dd;
    padding: 6px 10px;
    font-weight: 600;
    font-size: 12px;
    color: #344054;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    position: relative;
    user-select: none;
}
.spreadsheet-table tbody td {
    background: #fff;
    border: 1px solid #e4e7ec;
    padding: 5px 10px;
    color: #1d2939;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.spreadsheet-table tbody tr:hover td {
    background: #f0f4ff;
}

.col-resize-handle {
    position: absolute;
    right: 0;
    top: 0;
    bottom: 0;
    width: 5px;
    cursor: col-resize;
    z-index: 1;
}
.col-resize-handle:hover,
.col-resize-handle.resizing {
    background: #4a7cff;
}

/* ---------------------------------------------------------------------------
   Select2 — styled to look like the app's old Bootstrap filter dropdowns
   (.btn.btn-outline-secondary "pill" toggles with a leading icon).
   Every styled select2 lives inside a `.select2-icon-wrap` (set in the
   template), which also holds an absolutely-positioned leading lucide icon.
   Styling is wrapper-scoped (not select2-option-driven) so it never depends on
   JS; the compact size follows the source <select>.form-select-sm via :has().
   The open dropdown is appended at <body> level, so its panel/options are
   styled globally (all select2 in this app are the AJAX filter dropdowns).
   --------------------------------------------------------------------------- */
.select2-icon-wrap {
    position: relative;
    display: block;
}
.select2-icon-wrap .select2-lead-icon {
    position: absolute;
    left: 0.7rem;
    top: 50%;
    transform: translateY(-50%);
    width: 16px;
    height: 16px;
    color: #6c757d;
    pointer-events: none;
    z-index: 1;
}

.select2-icon-wrap .select2-container--default .select2-selection--single {
    min-height: calc(1.5em + 0.75rem + 2px);
    padding: 0.375rem 2.25rem 0.375rem 2rem;
    display: flex;
    align-items: center;
    border: 1px solid #6c757d;
    border-radius: 10px;
    background-color: #fff;
    color: #6c757d;
    font-weight: 500;
    transition: color var(--transition-fast), background-color var(--transition-fast),
        border-color var(--transition-fast), box-shadow var(--transition-fast);
}

/* Compact variant when the source select is .form-select-sm */
.select2-icon-wrap:has(select.form-select-sm) .select2-container--default .select2-selection--single {
    min-height: calc(1.5em + 0.5rem + 2px);
    padding: 0.25rem 2rem 0.25rem 1.85rem;
    font-size: 0.875rem;
}

.select2-icon-wrap .select2-container--default .select2-selection--single:hover {
    background-color: var(--surface-soft);
    border-color: #5c636a;
}

.select2-icon-wrap .select2-container--default .select2-selection__rendered {
    flex: 1 1 auto;
    min-width: 0;
    padding: 0;
    margin: 0;
    line-height: 1.5;
    text-align: left;
    color: inherit;
}
.select2-icon-wrap .select2-container--default .select2-selection__placeholder {
    color: #6c757d;
}

/* Caret tinted + flipped like the old dropdown-toggle */
.select2-icon-wrap .select2-container--default .select2-selection__arrow {
    height: 100%;
    right: 0.6rem;
}
.select2-icon-wrap .select2-container--default .select2-selection__arrow b {
    border-color: #6c757d transparent transparent transparent;
}
.select2-icon-wrap .select2-container--open .select2-selection__arrow b {
    border-color: transparent transparent #6c757d transparent;
}

.select2-icon-wrap .select2-container--default .select2-selection__clear {
    color: #6c757d;
    margin-right: 0.4rem;
    font-weight: 600;
}

/* Focus / open -> app's green ring (consistent with the rest of the UI) */
.select2-icon-wrap .select2-container--open .select2-selection--single,
.select2-icon-wrap .select2-container--focus .select2-selection--single {
    border-color: var(--main-color);
    color: var(--text-primary);
    box-shadow: 0 0 0 3px rgba(46, 204, 113, 0.16);
}

/* Form-context variant (`.select2-icon-wrap--form`).
   Same select2 anatomy, icon and dropdown as the filter dropdowns above, but
   wearing the .form-control skin so it sits with its sibling inputs on a form
   instead of reading as a filter pill. Only the resting state differs — the
   focus/open green ring is shared. Used by the catalog form's parent select. */
.select2-icon-wrap--form .select2-container--default .select2-selection--single {
    border-color: var(--border-color);
    color: var(--text-primary);
    font-weight: 400;
}
.select2-icon-wrap--form .select2-container--default .select2-selection--single:hover {
    background-color: #fff;
    border-color: var(--border-color);
}
.select2-icon-wrap--form .select2-container--open .select2-selection--single:hover,
.select2-icon-wrap--form .select2-container--focus .select2-selection--single:hover {
    border-color: var(--main-color);
}
.select2-icon-wrap--form .select2-container--default .select2-selection__arrow b {
    border-top-color: #9ca3af;
}
.select2-icon-wrap--form .select2-container--open .select2-selection__arrow b {
    border-top-color: transparent;
    border-bottom-color: #9ca3af;
}

/* Dropdown panel + options (rendered at <body> level — styled globally) */
.select2-dropdown {
    border: 1px solid var(--border-color);
    border-radius: 10px;
    box-shadow: var(--shadow-md);
    overflow: hidden;
}
.select2-search--dropdown .select2-search__field {
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 0.375rem 0.5rem;
}
.select2-search--dropdown .select2-search__field:focus {
    outline: 0;
    border-color: var(--main-color);
    box-shadow: 0 0 0 3px rgba(46, 204, 113, 0.16);
}
.select2-container--default .select2-results__option--highlighted,
.select2-container--default .select2-results__option--highlighted[aria-selected] {
    background-color: rgba(46, 204, 113, 0.12);
    color: var(--text-primary);
}
.select2-container--default .select2-results__option[aria-selected="true"],
.select2-container--default .select2-results__option--selected {
    background-color: var(--main-color);
    color: #fff;
}

/* "Items toevoegen"-modal: divider between the photo path and the
   collapsed manual-entry path (items_list.html). */
.upload-or {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 14px 0;
    color: #6c757d;
    font-size: 0.8rem;
}
.upload-or::before,
.upload-or::after {
    content: "";
    flex: 1 1 auto;
    border-top: 1px solid var(--border-color);
}

/* Multi-item review: "Meer items toevoegen" dashed placeholder row.
   Clicking it inserts a manual item row (review-multi-items.js). */
.add-item-row {
    border: 2px dashed var(--border-color);
    cursor: pointer;
    padding: 1rem;
    font-weight: 600;
    transition: background-color var(--transition-fast),
        border-color var(--transition-fast),
        color var(--transition-fast);
}
.add-item-row:hover,
.add-item-row:focus {
    background-color: rgba(0, 0, 0, 0.03);
    border-color: #94a3b8;
    color: #334155;
    outline: none;
}

/* Page-title breadcrumb (catalog / sub-catalog navigation).
   Ancestors are links styled like the title; hover reveals them. */
.title-breadcrumb a {
    color: inherit;
    text-decoration: none;
}
.title-breadcrumb a:hover,
.title-breadcrumb a:focus {
    color: var(--main-color);
    text-decoration: underline;
}
.title-breadcrumb .title-breadcrumb-sep {
    margin: 0 0.35rem;
    color: #94a3b8;
    font-weight: 400;
}

/* ============================================================
   Verwerkingstaken — one card per upload, each carrying its own
   next step. Card language taken from the approved prototype
   (proto/docs/demos/2026-08-17-upload-flow-demo.html): photo on
   top, kind chip top-left, status chip bottom-right, flat body.
   ============================================================ */
.task-card { margin-bottom: 12px; overflow: hidden; }
.task-card[data-state="awaiting_confirmation"],
.task-card[data-state="awaiting_review"] {
    border-color: rgba(46, 204, 113, 0.55);
    box-shadow: 0 0 0 3px rgba(46, 204, 113, 0.10);
}
.task-card[data-state="failed"] { border-color: #fecaca; }

.task-media { position: relative; height: 150px; display: flex; overflow: hidden; }
.task-photo { width: 100%; height: 100%; object-fit: cover; display: block; }
.task-photo-placeholder {
    object-fit: contain;
    background: var(--surface-soft);
    padding: 8%;
}

.task-kind-chip, .task-status-chip {
    position: absolute;
    display: inline-flex; align-items: center; gap: 5px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(4px);
    box-shadow: var(--shadow-sm);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.task-kind-chip {
    top: 8px; left: 8px; padding: 4px 9px; max-width: 62%;
    font-size: 0.68rem; font-weight: 600; letter-spacing: 0.02em;
    color: #475569;
}
.task-status-chip {
    bottom: 8px; right: 8px; padding: 5px 10px; max-width: 78%;
    font-size: 0.76rem; font-weight: 600; color: #334155;
}
.task-kind-chip svg, .task-status-chip svg { flex-shrink: 0; width: 13px; height: 13px; }
.task-status-chip .spinner-border {
    width: 0.8rem; height: 0.8rem; border-width: 0.14em; flex-shrink: 0;
}
.task-status-chip.is-action { background: var(--main-color); color: #fff; }
.task-status-chip.is-done { color: var(--main-color-darker); }
.task-status-chip.is-failed { background: #fef2f2; color: #b91c1c; }

.task-body { padding: 14px; }
.task-ask-label {
    font-size: 0.72rem; color: var(--text-muted);
    text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 4px;
}
/* The correction prompt must not read like fine print (Danny, 28-09). */
.task-ask-label--strong {
    font-size: 1.15rem; font-weight: 700; color: var(--text-primary);
    text-transform: none; letter-spacing: 0; margin-bottom: 8px;
}
.task-detected-name {
    font-size: 1.15rem; font-weight: 500;
    color: var(--text-primary); line-height: 1.3;
}
.task-detected-extra { font-size: 0.82rem; color: var(--text-muted); margin-top: 2px; }

/* One rule for every action row on a task card (owner, 29-09): the main
   action first, the secondary next, "Verwijderen" last and set apart —
   its own row on a phone, pushed right on desktop. */
.task-actions {
    display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 14px;
}
.task-actions > .btn:not(.btn-discard-upload) {
    flex: 1 1 0; min-height: 48px;
    display: inline-flex; align-items: center; justify-content: center; gap: 6px;
}
.task-actions > .btn-discard-upload { flex-basis: 100%; justify-content: flex-end; }

.task-correction { margin-top: 4px; display: grid; gap: 10px; }
.task-correction label {
    font-size: 0.78rem; color: var(--text-muted); margin-bottom: 2px; display: block;
}

.task-result { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.task-result-price { font-weight: 600; color: var(--text-primary); }
.task-result-link {
    display: inline-flex; align-items: center; gap: 4px;
    margin-top: 10px; font-weight: 500;
}
.task-result-link svg { width: 14px; height: 14px; }
.task-error { font-size: 0.9rem; color: #b91c1c; }
.task-fail-actions { display: flex; gap: 8px; margin-top: 12px; }
.task-fail-actions .btn-primary { flex: 1 1 auto; }

.task-empty { text-align: center; padding: 2.5rem 1rem; color: var(--text-muted); }
.task-empty svg { width: 32px; height: 32px; }

.badge-source {
    border: 1px solid rgba(46, 204, 113, 0.3);
    background: rgba(46, 204, 113, 0.12);
    color: var(--main-color-darker);
    font-size: 0.72rem;
}

/* Phone / tablet: "Verwijderen" leaves the action row and sits as a chip
   in the card's top-right corner, over the photo, matching the kind chip
   (owner, 29-09). Desktop keeps it at the end of the action row. The
   card (.card) is the positioned ancestor; the chip in a hidden block
   (the other half of Klopt dit? / Wat is het wel?) stays hidden. */
@media screen and (max-width: 991.98px) {
    .task-card .task-actions > .btn-discard-upload {
        position: absolute; top: 8px; right: 8px; z-index: 2;
        flex-basis: auto; min-height: 0;
        padding: 4px 10px; gap: 5px;
        border-radius: 999px;
        background: rgba(255, 255, 255, 0.9);
        backdrop-filter: blur(4px);
        box-shadow: var(--shadow-sm);
        font-size: 0.72rem; font-weight: 600; color: #475569;
    }
    /* 44px tap target around the small chip. */
    .task-card .task-actions > .btn-discard-upload::after {
        content: ""; position: absolute; inset: -8px;
    }
}

/* Desktop: a centered feed. Full-bleed photos look wrong stretched
   across the whole content column. */
@media screen and (min-width: 992px) {
    #task-list, #task-closer { max-width: 640px; margin-inline: auto; }
    .task-media { height: 180px; }
    .task-actions > .btn:not(.btn-discard-upload) { flex: 0 0 auto; min-width: 150px; }
    .task-actions > .btn-primary { min-width: 190px; }
    .task-actions > .btn-discard-upload { flex-basis: auto; margin-left: auto; }
}

/* An item the pipeline has identified but not finished: no price is
   established and the user still owes an answer on Verwerkingstaken.
   Reuses .processing-overlay's interaction block, with a static look
   instead of a spinner. */
.awaiting-overlay {
    background: rgba(255, 255, 255, 0.93);
    cursor: default;
}
.awaiting-overlay-icon {
    width: 26px;
    height: 26px;
    color: var(--main-color-dark);
}

/* ============================================================
   Gedetecteerde items — the review list. Same card language as
   Verwerkingstaken: loose cards 12px apart, flat bodies, the same
   padding. Card language taken from the approved prototype
   (proto/docs/demos/2026-08-17-upload-flow-demo.html).
   ============================================================ */

/* Bootstrap 5.3 ships no min-width-0 utility, and without one a flex
   child refuses to shrink below its content: a long detected name then
   pushes the trashcan off screen and the page scrolls sideways. */
.min-w-0 { min-width: 0; }

/* Fixed thumbnail sizes (review rows, source card). */
.review-thumb {
    width: 52px;
    height: 52px;
    flex: 0 0 52px;
    border-radius: var(--radius-sm);
    overflow: hidden;
    background: var(--surface-soft);
}
.review-thumb-lg { width: 72px; height: 72px; flex: 0 0 72px; }
.review-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }

.review-source { display: flex; gap: 12px; align-items: center; }

.review-item { margin-bottom: 12px; }
.review-item .card-body { padding: 14px; }
.review-item-top { display: flex; align-items: flex-start; gap: 10px; }
.review-item-top .review-thumb { margin-top: 6px; }
.review-item-top .btn-icon-touch { align-self: center; }
.review-item-fields-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-top: 10px;
}
.review-item label {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-bottom: 2px;
    display: block;
}
.review-item-notes {
    margin-top: 10px;
    font-size: 0.8rem;
    color: var(--text-muted);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.review-error { font-size: 0.8rem; color: #dc2626; }

/* Actions after the list, in reading order: approve first, back below. */
.review-actions { display: grid; gap: 10px; margin-top: 14px; }
.review-actions .btn {
    min-height: 50px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

/* The dashed add row sits between the list and the actions. */
#review-add-row { border-radius: var(--radius-md); margin-bottom: 14px; }

@media screen and (min-width: 992px) {
    /* Same centered feed as the task list, so taken -> beoordelen reads
       as one surface rather than two different pages. */
    #review-screen { max-width: 640px; margin-inline: auto; }
    .review-actions {
        display: flex;
        flex-direction: row-reverse;
        justify-content: flex-start;
    }
    .review-actions .btn-primary { min-width: 320px; }
}

/* A review row flagged as a possible duplicate of an existing item. The
   warning sits on the row, not on a second screen: approving the row is
   what settles the suspicion. */
.review-item-warning {
    display: flex;
    align-items: flex-start;
    gap: 5px;
    margin-top: 10px;
    font-size: 0.8rem;
    line-height: 1.35;
    color: #b45309;
}
.review-item-warning svg {
    width: 14px;
    height: 14px;
    flex-shrink: 0;
    margin-top: 1px;
}

/* ============================================================
   In behandeling: finished cards step back. The list reads like a
   message list — anything still expecting something keeps full weight
   at the top, finished uploads sit underneath, quieter, and can be
   taken off the list individually.
   ============================================================ */
.task-card[data-done="1"] {
    border-color: var(--border-color);
    box-shadow: none;
    background: var(--surface-soft);
}
.task-card[data-done="1"] .task-media { height: 96px; }
.task-card[data-done="1"] .task-photo { opacity: 0.55; filter: saturate(0.7); }
.task-card[data-done="1"] .task-kind-chip { opacity: 0.75; }
.task-card[data-done="1"] .task-body { padding: 10px 14px; }

.task-done-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}
.task-done-actions .task-result-link { margin-top: 0; }

/* Deliberately low-contrast: clearing the list is housekeeping, never
   the thing we invite the user to do on this page. */
.btn-remove-upload,
.btn-discard-upload {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 2px;
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.8rem;
}
.btn-remove-upload:hover,
.btn-remove-upload:focus,
.btn-discard-upload:hover,
.btn-discard-upload:focus-visible { color: #b91c1c; }
.btn-remove-upload svg,
.btn-discard-upload svg { width: 13px; height: 13px; }

.task-pagination-wrap { max-width: 640px; margin-inline: auto; }

@media screen and (max-width: 768px) {
    /* Touch target on a low-contrast control still has to be reachable. */
    .btn-remove-upload,
    .btn-discard-upload { min-height: 44px; padding: 10px 4px; }
}

/* Item rows must read as clickable (Danny, 28-09): the title underlines on
   hover and a chevron opens the item. No stretched-link — the row carries
   inline value / quantity / proof controls that must keep their own taps. */
.item-card-wrapper .card-title a:hover,
.item-card-wrapper .card-title a:focus-visible { text-decoration: underline; }
/* Location cards and sub-location rows, same signal (Tom, 28-09: "mensen
   zien dat staan en denken: dat is gewoon tekst"). The text block is
   already one link; the name underlines when it is hovered. */
.catalog-card a:hover .card-title,
.catalog-card .card-title a:hover,
.catalog-card a:focus-visible .card-title,
#sub-catalogs a:hover .card-title,
#sub-catalogs a:focus-visible .card-title { text-decoration: underline; }
.item-card-wrapper .mobile-item-actions .item-open-chevron { margin-left: auto; }

/* Receipt upload modal (partials/receipt_upload_modal.html). Progress looks
   like the file uploader's (file-uploader.css): 8px track, app green fill. */
.receipt-progress-label {
    display: flex; justify-content: space-between; gap: 12px;
    font-size: 0.9rem; font-weight: 500; color: var(--text-primary);
    margin-bottom: 8px;
}
.receipt-progress {
    height: 8px; border-radius: 4px; overflow: hidden;
    background: var(--border-color);
}
.receipt-progress-fill {
    height: 100%; width: 0%; border-radius: 4px;
    background: var(--main-color);
    transition: width 200ms ease;
}
/* Before the first progress event (compressing, connecting). */
.receipt-progress-fill.is-waiting {
    width: 30%;
    animation: receipt-progress-wait 1.2s ease-in-out infinite;
}
@keyframes receipt-progress-wait {
    from { transform: translateX(-100%); }
    to   { transform: translateX(340%); }
}
@media (prefers-reduced-motion: reduce) {
    .receipt-progress-fill.is-waiting { animation: none; width: 100%; opacity: 0.4; }
}
.receipt-status-line {
    display: flex; align-items: center; gap: 10px;
    font-weight: 500; color: var(--text-primary);
}
.receipt-spinner { color: var(--main-color); }
.receipt-line {
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    background: var(--surface-soft);
    padding: 12px 14px;
}
.receipt-line-name { font-weight: 600; color: var(--text-primary); }
#receipt-upload-modal .alert svg { width: 18px; height: 18px; flex-shrink: 0; }
/* Phone: three answers do not fit one row. Stack them full width with the
   main answer on top, the destructive one last (DOM order is desktop's). */
@media (max-width: 575.98px) {
    #receipt-upload-modal [data-footer="ready"] {
        flex-direction: column-reverse; align-items: stretch; gap: 8px;
    }
    #receipt-upload-modal [data-footer="ready"] > .btn { width: 100%; margin: 0; }
}
