/* RayFlexCom Customer Manager: small additions on top of Bootstrap 5. */

/* RayFlexCom brand design tokens (huisstijl). */
:root {
    --rfx-blue: #009fe3;
    --rfx-blue-dark: #0072b0;
    --rfx-orange: #ec6608;
    --rfx-ink: #1d1d1b;
}

/* Brand accent line under the top navigation. */
.navbar.bg-dark {
    border-bottom: 3px solid var(--rfx-blue);
}

/* White chip behind the official logo so the (dark-inked) brand mark stays
 * legible on the dark navbar and the login page. The logo asset itself is
 * never modified. Kept compact and responsive. */
.rfx-logo-chip {
    display: inline-flex;
    align-items: center;
    background: #fff;
    padding: 4px 8px;
    border-radius: 6px;
    line-height: 0;
}
.navbar .rfx-logo-chip {
    padding: 3px 6px;
}

/* Use the brand blue for the "info" accent (Customer Manager wordmark,
 * tooltips on chips) so it matches the logo exactly. */
.navbar .text-info {
    color: var(--rfx-blue) !important;
}

/* Mark required form fields with an asterisk after the label. */
.required > .form-label::after {
    content: " *";
    color: var(--bs-danger);
}

/* Identifiers (SAP-IDs, GUIDs, tokens) in tables. */
.app-mono {
    font-family: var(--bs-font-monospace);
    font-size: 0.875em;
}

/* Truncated text cells in dense tables; full text via title tooltip. */
.rcm-truncate {
    display: inline-block;
    max-width: 16rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    vertical-align: bottom;
}
@media (max-width: 991.98px) {
    .rcm-truncate {
        max-width: 11rem;
    }
}

/* Code values are plain monospace, not the default pink <code>;
 * status colours are reserved for conclusions and badges. */
code {
    color: var(--bs-body-color);
}

/* Dashboard stat cards. */
.stat-card .stat-value {
    font-size: 2rem;
    font-weight: 600;
    line-height: 1.2;
}

/* Detail-page section accents (family pattern, RDM release 0.7). A soft,
 * business-like accent on the inline-start border plus a very light header
 * tint, so each main section is recognisable. Status colours
 * (green/orange/red) stay reserved for badges; these tokens are neutral
 * hues. Applied to the .card of each main section via a modifier class. */
.rcm-section {
    border-inline-start: 4px solid var(--rcm-section-accent, var(--rfx-blue));
}
.rcm-section > .card-header {
    background: var(--rcm-section-header-bg, transparent);
}
.rcm-section--customer { --rcm-section-accent: #2f6fb0; --rcm-section-header-bg: rgba(47, 111, 176, 0.06); }
.rcm-section--contacts { --rcm-section-accent: #2aa79b; --rcm-section-header-bg: rgba(42, 167, 155, 0.07); }
.rcm-section--locations { --rcm-section-accent: #5b8fbf; --rcm-section-header-bg: rgba(91, 143, 191, 0.06); }
.rcm-section--roles { --rcm-section-accent: #cf8a3a; --rcm-section-header-bg: rgba(207, 138, 58, 0.07); }
.rcm-section--notes { --rcm-section-accent: #8a7fb0; --rcm-section-header-bg: rgba(138, 127, 176, 0.07); }
.rcm-section--audit { --rcm-section-accent: #6c8ea0; --rcm-section-header-bg: rgba(108, 142, 160, 0.07); }

/* Rotating disclosure chevron (shared by every collapsible toggle). */
.rcm-chevron {
    display: inline-block;
    transition: transform 0.15s ease;
}
.rcm-more-filters-toggle[aria-expanded="true"] .rcm-chevron {
    transform: rotate(90deg);
}
/* Swap the "Meer filters" / "Minder filters" label based on the panel state. */
.rcm-more-filters-toggle .rcm-label-less {
    display: none;
}
.rcm-more-filters-toggle[aria-expanded="true"] .rcm-label-more {
    display: none;
}
.rcm-more-filters-toggle[aria-expanded="true"] .rcm-label-less {
    display: inline;
}

/* Compact tables keep the primary actions visible without horizontal
 * scrolling via a sticky right-hand action column. */
.rcm-compact-table {
    margin-bottom: 0;
}
.rcm-compact-table th,
.rcm-compact-table td {
    vertical-align: middle;
}
.rcm-sticky-actions th.rcm-action-col,
.rcm-sticky-actions td.rcm-action-col {
    position: sticky;
    right: 0;
    background: var(--bs-body-bg, #fff);
    box-shadow: -6px 0 6px -6px rgba(0, 0, 0, 0.15);
    z-index: 2;
}

/* Operational knowledge base: accessible code blocks with copy buttons. */
.rcm-kb-pre {
    background: #f6f8fa;
    border: 1px solid #e1e4e8;
    border-radius: 0.375rem;
    padding: 0.75rem 1rem;
    overflow-x: auto;
    white-space: pre;
}
.rcm-kb-pre code {
    color: #1d1d1b;
    background: transparent;
    font-size: 0.875rem;
}
.rcm-kb-copy {
    position: absolute;
    top: 0.4rem;
    right: 0.4rem;
}

/* Page-filling overlay shown while a longer server action runs. Blocks
   interaction; sufficient contrast on the panel. */
.rcm-overlay {
    position: fixed;
    inset: 0;
    z-index: 1080;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(15, 23, 42, 0.55);
}

.rcm-overlay__panel {
    background: #fff;
    color: #1f2937;
    padding: 1.75rem 2rem;
    border-radius: 0.5rem;
    box-shadow: 0 0.5rem 1.5rem rgba(0, 0, 0, 0.3);
    max-width: 28rem;
}

/* Dashboard drilldown tiles (family pattern, RDM 1.5.0 fase 1) — clear
   hover and keyboard-focus states for clickable tiles; non-clickable (0)
   tiles keep the plain card. */
.stat-card .stat-link { color: inherit; border-radius: 0.375rem; }
.stat-card:has(.stat-link):hover {
    border-color: var(--bs-primary, #0d6efd);
    box-shadow: 0 0 0 1px var(--bs-primary, #0d6efd);
}
.stat-card .stat-link:hover .stat-value { text-decoration: underline; }
.stat-card .stat-link:focus-visible {
    outline: 2px solid var(--bs-primary, #0d6efd);
    outline-offset: 2px;
}

/* Klantnotities als subtiele post-it (familiepatroon, RDM 1.5.3 §16) —
   professioneel en rustig, met dezelfde kaartkop als de overige kaarten en
   goed tekstcontrast. */
.rcm-notes-card > .card-body {
    background: #fdf9e8;
}
.rcm-notes-card {
    border-inline-start: 4px solid #e3d489;
}

/* Witte topnavigatie met blauwe onderrand (huisstijl 25 jaar, RDM 1.5.5). */
.rcm-topnav {
    border-bottom: 3px solid #009FE3;
}
.rcm-topnav .nav-link {
    color: #1D1D1B;
}
.rcm-topnav .nav-link:hover,
.rcm-topnav .nav-link:focus,
.rcm-topnav .nav-link.active {
    color: #0072B0;
}

/* Generic icons (uploaded asset or initial fallback), e.g. avatars. */
.rcm-provider-icon {
    object-fit: contain;
    border-radius: 3px;
    vertical-align: text-bottom;
}
.rcm-provider-initial {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 3px;
    background: #e9ecef;
    color: #495057;
    font-size: 0.7rem;
    font-weight: 600;
    vertical-align: text-bottom;
}

/* The shared section disclosure header (family pattern, RDM 2.1.0). The
   whole title/status area is one button with a generous hit area
   (>= 40px), a rotating chevron and clearly visible hover/keyboard-focus
   states. Action buttons live next to (never inside) the toggle. */
.rcm-section-toggle {
    display: flex;
    align-items: center;
    gap: .5rem;
    flex-wrap: wrap;
    min-height: 40px;
    padding: .5rem .75rem;
    border: 0;
    background: transparent;
    text-align: left;
    width: auto;
    color: inherit;
    font: inherit;
}
.rcm-section-toggle:hover {
    background: rgba(0, 0, 0, 0.05);
}
.rcm-section-toggle:focus-visible {
    outline: 2px solid var(--rfx-blue, #009fe3);
    outline-offset: -2px;
}
.rcm-section-toggle .rcm-chevron {
    display: inline-block;
    transition: transform .15s ease-in-out;
}
.rcm-section-toggle[aria-expanded="true"] .rcm-chevron {
    transform: rotate(90deg);
}

.rcm-subsection-toggle {
    border: 1px solid var(--bs-border-color, #dee2e6);
    border-radius: .375rem;
    background: var(--bs-tertiary-bg, #f8f9fa);
}
.rcm-subsection-toggle:hover {
    background: rgba(0, 0, 0, 0.07);
}

.rcm-section-toggle__summary {
    display: inline-flex;
    align-items: center;
    gap: .35rem;
    flex-wrap: wrap;
    font-weight: 400;
    font-size: .875rem;
    color: var(--bs-secondary-color, #6c757d);
}

/* Central button contrast rules (family, RDM 2.1.0). Primary uses the
   darker house blue for WCAG AA contrast with white text; every button
   keeps a visible keyboard focus ring; light gray is reserved for
   genuinely disabled controls. */
.btn-primary {
    --bs-btn-bg: #0072b0;
    --bs-btn-border-color: #0072b0;
    --bs-btn-hover-bg: #005a8c;
    --bs-btn-hover-border-color: #005a8c;
    --bs-btn-active-bg: #004d78;
    --bs-btn-active-border-color: #004d78;
}
.btn-outline-primary {
    --bs-btn-color: #0072b0;
    --bs-btn-border-color: #0072b0;
    --bs-btn-hover-bg: #0072b0;
    --bs-btn-hover-border-color: #0072b0;
    --bs-btn-active-bg: #005a8c;
    --bs-btn-active-border-color: #005a8c;
}
.btn:focus-visible {
    outline: 2px solid var(--rfx-blue, #009fe3);
    outline-offset: 2px;
}

/* The native multi-select filter dropdown (details/summary + checkboxes,
   no JavaScript; family pattern, RDM 2.3.0). The summary reuses the
   Bootstrap select look; the panel floats over the table below it. */
.rcm-multiselect {
    position: relative;
}
.rcm-multiselect > summary {
    list-style: none;
    cursor: pointer;
}
.rcm-multiselect > summary::-webkit-details-marker {
    display: none;
}
.rcm-multiselect[open] > summary {
    border-color: #0072b0;
}
.rcm-multiselect-panel {
    position: absolute;
    z-index: 1050;
    min-width: 100%;
    width: max-content;
    max-width: 24rem;
    max-height: 15rem;
    overflow-y: auto;
    padding: .5rem .75rem;
    margin-top: .125rem;
}

/* Fully self-contained option rows (RDM 2.3.0c). Bootstrap's .form-check
   float/negative-margin model collapsed row heights in some engines
   (Edge) so wrapped labels overlapped the following rows; a two-column
   grid per option cannot collapse: the row is as tall as its label. */
.rcm-multiselect-option {
    display: grid;
    grid-template-columns: auto 1fr;
    column-gap: .4rem;
    align-items: start;
    margin: 0 0 .4rem;
    font-size: .875rem;
    line-height: 1.35;
    cursor: pointer;
}
.rcm-multiselect-option:last-child {
    margin-bottom: 0;
}
.rcm-multiselect-option input[type="checkbox"] {
    margin: .2rem 0 0;
    float: none;
}
.rcm-multiselect-option span {
    display: block;
    white-space: normal;
    overflow-wrap: anywhere;
    min-width: 0;
}
.rcm-filter-op {
    width: 3.6rem;
    flex: 0 0 auto;
}
.rcm-filter-value {
    flex: 1 1 auto;
    min-width: 0;
}
