/* Received-invoices inbox (Achats / master-detail). GLOBAL sheet — this app does not wire the Blazor
   scoped-CSS bundle, so the inbox layout lives here and is loaded from index.html. Metronic owns the chrome
   (card card-flush / row / col / badges / typography); this file only styles the compact master rows, the
   read/unread affordances and recolours the pills to the brand mauve (secondary-sidebar tone). All colours
   resolve to Bootstrap/Metronic CSS variables so light and dark themes are honoured. */

/* ---- Pills: brand mauve active state (instead of the solid bright-green primary) ----
   Matches the secondary sidebar tone (--bs-app-sidebar-secondary-base-bg-color = --bs-primary-light). */
.ri-view-toggle .nav-link.active,
.ri-inbox-tabs .nav-link.active {
    background-color: var(--bs-primary-light);
    color: var(--bs-primary);
}

.ri-view-toggle .nav-link,
.ri-inbox-tabs .nav-link {
    color: var(--bs-gray-700);
}

.ri-view-toggle .nav-link:hover:not(.active),
.ri-inbox-tabs .nav-link:hover:not(.active) {
    background-color: var(--bs-gray-100);
}

/* ---- Master list ---- */
.ri-mlist {
    display: flex;
    flex-direction: column;
    max-height: calc(100vh - 360px);
    overflow-y: auto;
    outline: none;
}

.ri-mrow {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 0.15rem 0.75rem;
    padding: 0.75rem 0.875rem 0.75rem 1.5rem;
    border-bottom: 1px solid var(--bs-border-color);
    cursor: pointer;
    position: relative;
    transition: background-color 0.12s ease;
}

.ri-mrow:hover {
    background-color: var(--bs-gray-100);
}

.ri-mrow.ri-selected {
    background-color: var(--bs-primary-light);
}

.ri-mrow.ri-selected::after {
    content: "";
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    background-color: var(--bs-primary);
}

.ri-mrow.ri-unread::before {
    content: "";
    position: absolute;
    left: 0.55rem;
    top: 1.05rem;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background-color: var(--bs-primary);
}

.ri-m-sup {
    font-weight: 600;
    color: var(--bs-gray-800);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 180px;
}

.ri-mrow.ri-unread .ri-m-sup {
    font-weight: 800;
}

.ri-m-amt {
    font-weight: 700;
    color: var(--bs-gray-900);
    font-variant-numeric: tabular-nums;
    text-align: right;
    white-space: nowrap;
}

.ri-m-meta {
    color: var(--bs-gray-600);
    font-size: 0.8rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ri-m-right {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    justify-content: flex-end;
}

.ri-m-date {
    color: var(--bs-gray-500);
    font-size: 0.78rem;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.ri-mlist-empty {
    padding: 2.5rem 1rem;
    text-align: center;
    color: var(--bs-gray-500);
    font-weight: 600;
}

.ri-kbd-hint {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    color: var(--bs-gray-500);
    font-size: 0.78rem;
}

.ri-kbd {
    border: 1px solid var(--bs-border-color);
    border-bottom-width: 2px;
    border-radius: 4px;
    background-color: var(--bs-body-bg);
    padding: 0 0.3rem;
    font-size: 0.7rem;
    color: var(--bs-gray-700);
    margin-right: 0.1rem;
}

/* ---- Detail pane empty state ---- */
.ri-detail-empty {
    padding: 4.5rem 1.5rem;
    text-align: center;
}

/* ---- List-view unread dot ---- */
.ri-list-dot {
    display: inline-block;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background-color: var(--bs-primary);
    margin-right: 0.5rem;
    flex: none;
}

/* ---- Responsive: on a stacked (mobile) layout, show only one pane at a time ---- */
@media (max-width: 991.98px) {
    .ri-inbox-layout[data-mobile-detail="true"] .ri-pane-list {
        display: none;
    }

    .ri-inbox-layout:not([data-mobile-detail="true"]) .ri-pane-detail {
        display: none;
    }

    .ri-mlist {
        max-height: none;
    }
}
