/* =========================================================================
   Config app (/admin) shared styling — the .cfg-* system.
   Extracted from the per-page inline <style> blocks (Blok 6 Modules, Blok 7
   Role templates) so every Config editor (Blok 6-9) shares one source. Plain
   custom CSS in the house palette; loaded globally via App.razor. Page-specific
   one-offs may still live in a page, but the shared vocabulary lives here.
   ========================================================================= */

.cfg-lead { color: #4a5b60; font-size: .92rem; max-width: 56rem; margin: .2rem 0 1rem; line-height: 1.5; }
.cfg-muted { color: #7a8c90; font-size: .9rem; }

/* ---- alert ---- */
.cfg-alert {
    border: 1px solid #f0c7c9; border-left: 4px solid #c0392b; background: #fbeaea;
    color: #8f1c22; border-radius: 6px; padding: .5rem .75rem; margin-bottom: .9rem;
    font-size: .9rem; display: flex; align-items: center; justify-content: space-between; gap: 1rem;
}
.cfg-alert-x { background: none; border: none; color: #8f1c22; font-size: 1.1rem; cursor: pointer; line-height: 1; }

/* ---- card ---- */
.cfg-card { border: 1px solid #dfe6e7; border-radius: 8px; background: #fff; padding: .75rem .9rem; margin-bottom: 1rem; }
.cfg-card-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: .6rem; }
.cfg-card-head h2 { font-size: 1.05rem; margin: 0; display: flex; align-items: center; gap: .5rem; }
.cfg-count { font-size: .72rem; color: #55666b; background: #eef3f3; border-radius: 10px; padding: .05rem .5rem; font-weight: 600; }
.cfg-tpl-name { color: #143b45; }

/* ---- table ---- */
.cfg-table-wrap { overflow-x: auto; }
.cfg-table { width: 100%; border-collapse: collapse; font-size: .86rem; }
.cfg-table th, .cfg-table td { text-align: left; padding: .35rem .55rem; border-bottom: 1px solid #eef2f2; white-space: nowrap; }
.cfg-table th { font-size: .72rem; color: #7a8c90; font-weight: 600; }
.cfg-table tbody tr:hover { background: #f6f9f9; }
.cfg-table code { font-size: .82rem; color: #14607a; background: #eef3f3; padding: 0 .3rem; border-radius: 3px; }
.cfg-actions-h, .cfg-actions { text-align: right; }
.cfg-inactive td:not(.cfg-actions):not(.cfg-matrix-mode) { color: #9aa7ab; }

/* ---- status pill ---- */
.cfg-pill { font-size: .68rem; font-weight: 600; padding: .05rem .45rem; border-radius: 10px; }
.cfg-pill-on { color: #1d6a3a; background: #e3f2e8; }
.cfg-pill-off { color: #8a6d3b; background: #f6ead9; }
.cfg-pill-super { color: #7a5b12; background: #f6e6b8; }
.cfg-pill-plain { color: #55666b; background: #eef3f3; }
/* provenance pills for the effective-rights lens (Blok 13) */
.cfg-pill-tpl { color: #14607a; background: #e3eef2; }
.cfg-pill-ovr { color: #7a3b6a; background: #f2e3ee; }
.cfg-pill-pub { color: #4a5d1f; background: #ecf1dd; }   /* Blok 25: open to every member of the firma */

/* ---- firma-membership chips in the user list (Blok 8 UX) ---- */
.cfg-firma-chips { display: flex; flex-wrap: wrap; gap: .25rem; }
.cfg-firma-chips .cfg-pill { display: inline-flex; align-items: center; gap: .2rem; }

/* ---- success/info alert (green sibling of .cfg-alert) ---- */
.cfg-alert-ok {
    border: 1px solid #bfe3cd; border-left: 4px solid #1d6a3a; background: #eaf6ee;
    color: #1d6a3a; border-radius: 6px; padding: .5rem .75rem; margin-bottom: .9rem;
    font-size: .9rem; display: flex; align-items: center; justify-content: space-between; gap: 1rem;
}
.cfg-alert-ok .cfg-alert-x { color: #1d6a3a; }

/* ---- inline add-row (e.g. an override: module + mode + add) ---- */
.cfg-row { display: flex; gap: .5rem; align-items: flex-end; flex-wrap: wrap; }
.cfg-sub-title { font-weight: 600; font-size: .9rem; margin: .9rem 0 .5rem; color: #24343a; }

/* ---- buttons ---- */
.cfg-btn {
    font-size: .82rem; padding: .3rem .7rem; border-radius: 6px; border: 1px solid #cdd8da;
    background: #fff; color: #24343a; cursor: pointer;
}
.cfg-btn:hover { background: #eef3f3; }
.cfg-btn-sm { padding: .18rem .5rem; font-size: .78rem; margin-left: .25rem; }
.cfg-btn-primary { background: #143b45; border-color: #143b45; color: #fff; }
.cfg-btn-primary:hover { background: #1d525f; }
.cfg-btn-danger { color: #8f1c22; border-color: #e2b6b8; }
.cfg-btn-danger:hover { background: #fbeaea; }
.cfg-btn:disabled { opacity: .5; cursor: not-allowed; }

/* ---- Users screen: compact HORIZONTAL action row; fixed per-button widths so every button type
       lines up in its own vertical column across all rows (Delete under Delete, Edit under Edit …). ---- */
.cfg-act-assign { width: 6rem; }
.cfg-act-edit   { width: 3.6rem; }
.cfg-act-admin  { width: 6.4rem; }
.cfg-act-active { width: 5.4rem; }
.cfg-act-del    { width: 3.8rem; }

/* ---- clickable DB-footprint number → inline breakdown ---- */
.cfg-fp-btn { background: none; border: none; padding: 0; cursor: pointer; font: inherit; }
.cfg-fp-btn:hover .cfg-pill { text-decoration: underline; }
.cfg-fp-open .cfg-pill { outline: 1px solid #c99a52; outline-offset: 1px; }

/* ---- card-head tools (inline toggle + primary button) ---- */
.cfg-check-inline { display: inline-flex; align-items: center; gap: .3rem; font-size: .8rem; color: #55666b; white-space: nowrap; cursor: pointer; }
.cfg-check-inline input { cursor: pointer; }
.cfg-confirm { font-size: .8rem; color: #8f1c22; margin-right: .35rem; }
/* Blok 14: the family chips in the /admin/modules rail (one rail, two catalogs) */
.cfg-family { display: inline-flex; gap: .25rem; }
.cfg-family-chip { font: inherit; font-size: .8rem; padding: .2rem .6rem; border: 1px solid #cfd9db; border-radius: 999px; background: #fff; color: #55666b; cursor: pointer; }
.cfg-family-chip .cfg-count { margin-left: .25rem; }
.cfg-family-chip:hover { border-color: #9fb3b7; }
.cfg-family-on, .cfg-family-on:hover { background: #1d5666; border-color: #1d5666; color: #fff; }
.cfg-family-on .cfg-count { color: #d9e6e9; }
/* Blok 14: the access matrix inside a template's fiche - department blocks, changed rows */
.cfg-matrix-group th { background: #eef3f3; color: #1d5666; font-weight: 400; padding: .45rem .6rem; }
.cfg-matrix-group th .cfg-swatch { margin-right: .35rem; }
.cfg-row-changed td { background: #fff8e6; }

/* ---- edit form ---- */
.cfg-form { border: 1px dashed #bcccce; background: #f8fbfb; border-radius: 8px; padding: .75rem .9rem; margin-bottom: .9rem; }
.cfg-form-title { font-weight: 600; margin-bottom: .6rem; }
.cfg-form-note { margin: .6rem 0 0; }
.cfg-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(13rem, 1fr)); gap: .6rem .8rem; align-items: end; }
.cfg-span2 { grid-column: span 2; }
.cfg-field { display: flex; flex-direction: column; gap: .2rem; font-size: .8rem; color: #55666b; }
.cfg-field > span { font-weight: 600; }
.cfg-req { color: #c0392b; font-style: normal; }
.cfg-input {
    font-size: .88rem; padding: .32rem .5rem; border: 1px solid #cdd8da; border-radius: 6px;
    background: #fff; color: #1f2d32; width: 100%;
}
.cfg-input:read-only { background: #eef2f2; color: #55666b; }
.cfg-hint { color: #9aa7ab; font-size: .72rem; font-weight: 400; }
.cfg-check { display: flex; align-items: center; gap: .4rem; font-size: .85rem; color: #24343a; }
/* Blok 24: the department checkboxes in the firma-access form (several may be ticked). */
.cfg-check-group { display: flex; flex-wrap: wrap; gap: .35rem .9rem; padding: .3rem 0; }
.cfg-form-actions { margin-top: .8rem; display: flex; gap: .5rem; }
.validation-message { color: #c0392b; font-size: .74rem; }

/* ---- one-time secret box (Blok 15.5 machine clients) ---- */
.cfg-secret {
    border: 1px solid #cfe3d6; border-left: 4px solid #1d6a3a; background: #eef7f1;
    border-radius: 6px; padding: .7rem .85rem; margin-bottom: .9rem;
}
.cfg-secret-title { font-weight: 600; color: #1d6a3a; margin-bottom: .4rem; display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.cfg-secret-title .cfg-alert-x { color: #1d6a3a; }
.cfg-secret-value {
    font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: .9rem;
    background: #fff; border: 1px solid #cdd8da; border-radius: 6px; padding: .45rem .6rem;
    word-break: break-all; user-select: all; color: #1f2d32;
}
.cfg-secret-warn { color: #8a6d3b; font-size: .78rem; margin: .4rem 0 0; line-height: 1.45; }

/* ---- matrix editor (Blok 7 role templates) ---- */
.cfg-matrix-lead { margin: -.2rem 0 .7rem; }
.cfg-matrix td { vertical-align: middle; }
.cfg-matrix-mode-h, .cfg-matrix-mode { width: 14rem; }
.cfg-matrix-select { max-width: 13rem; }

/* ---- search bar (filter a long list on the spot) ---- */

/* ---- sortable column headers ---- */

/* ---- inline detail row: the edit/assignments panel opens UNDER the clicked row ---- */
.cfg-table tr.cfg-row-active > td { background: #eef3f3; }
.cfg-detail-row > td { padding: .1rem 0 .7rem; white-space: normal; background: #f8fbfb; }
.cfg-detail-row .cfg-form { margin-bottom: 0; border-top: none; border-top-left-radius: 0; border-top-right-radius: 0; }
.cfg-detail-panel { border: 1px dashed #bcccce; border-top: 3px solid #143b45; background: #f8fbfb; border-radius: 0 0 8px 8px; padding: .75rem .9rem; }
.cfg-detail-panel .cfg-card-head { margin-bottom: .5rem; }
.cfg-detail-panel .cfg-card { border: none; padding: 0; margin: 0; background: transparent; }

/* =========================================================================
   Config-secties als BOVENBALK (AdminSections Top="true" / AdminTopLayout).
   Blok 14 — proef op /admin/users.

   Waarom hier en niet in een .razor.css: <NavLink> is een child-component en
   krijgt het [b-…] scope-attribuut van de layout niet. Scoped zou stil niets
   doen. Dezelfde reden als bij mg-finder.css.

   Compact by design: deze balk mag in de hoogte niet terugpakken wat hij in
   de breedte teruggeeft. Zeven vaste keuzes horen op één regel te passen.
   ========================================================================= */
.admin-shell-top {
    display: flex;
    flex-direction: column;
    gap: .6rem;
    min-height: calc(100vh - 3rem - 1rem);
}

.admin-sec--top {
    display: flex;
    align-items: center;
    gap: .6rem;
    flex-wrap: wrap;
    border-bottom: 1px solid #dfe6e7;
    padding-bottom: .5rem;
}

.admin-sec--top .admin-sec-title {
    font-size: .68rem;
    color: #7a8c90;
    white-space: nowrap;
}

.admin-sec--top .admin-sec-list { display: flex; flex-wrap: wrap; gap: .3rem; }

.admin-sec--top .admin-sec-item {
    display: inline-flex;
    align-items: center;
    padding: .3rem .7rem;
    border: 1px solid #e3eaeb;
    border-radius: 6px;
    background: #f2f6f6;
    color: #24343a;
    font-size: .84rem;
    line-height: 1.3;
    text-decoration: none;
    white-space: nowrap;
}

.admin-sec--top a.admin-sec-item:hover { background: #e7eff0; border-color: #cfdcde; }

/* Actief = waar je bent. Zelfde donkergroen als de rail had, zodat de wissel geen nieuw
   vocabularium introduceert. Geen bold: het platform gebruikt kleur, niet gewicht. */
.admin-sec--top .admin-sec-item.active { background: #143b45; border-color: #143b45; color: #fff; }

.admin-body-top {
    flex: 1;
    min-width: 0;
    min-height: 0;   /* zonder dit groeit een flex-item mee met zijn inhoud i.p.v. te scrollen */
    padding: 0 .2rem;
}

/* Smal scherm: het contextlabel valt weg, de knoppen wrappen vanzelf. */
@media (max-width: 700px) {
    .admin-sec--top .admin-sec-title { display: none; }
}

/* Blok 23 - a department's colour, shown in the modules table and picked in the form. */
.cfg-swatch { display: inline-block; width: .9rem; height: .9rem; border-radius: 3px; vertical-align: -.1rem; margin-right: .35rem; border: 1px solid rgba(0,0,0,.15); }
.cfg-colour-row { display: flex; gap: .5rem; align-items: center; }
.cfg-colour-row input[type="color"] { width: 2.4rem; height: 2rem; padding: 0; border: 1px solid #cfd8da; border-radius: 4px; background: none; }
