/* ==========================================================================
   Template page chrome: page banner (PageHeader), stat cards (FmStat),
   list avatars (FmAvatar) and table-card refinements. Values come from the
   role-dashboards template's computed styles. Loaded after fm-pages.css.
   ========================================================================== */

/* ---------- Page banner: breadcrumb · title · subtitle · actions ---------- */
.fm-ph {
    position: relative; isolation: isolate; overflow: hidden;
    display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 1rem;
    padding: 1.4rem 1.7rem; margin: .75rem 1rem 1.2rem; border-radius: 18px; color: #fff;
    background: radial-gradient(420px 240px at 95% -20%, rgba(227, 205, 148, .55), transparent 62%),
                radial-gradient(360px 220px at 5% 130%, rgba(90, 160, 220, .4), transparent 60%),
                linear-gradient(115deg, #0b1426 0%, #1b2a6b 58%, #4a2f7a 100%);
    box-shadow: 0 20px 40px -14px rgba(27, 42, 107, .55), inset 0 1px 0 rgba(255, 255, 255, .14);
}
/* animated connected-node layer (canvas drawn by js/fm-fx.js), on the action side, fading toward the title */
.fm-ph > *:not(.fm-geo) { position: relative; z-index: 1; }
.fm-geo {
    position: absolute; z-index: 0; top: 0; right: 0; bottom: 0; left: auto; width: min(38%, 380px);
    overflow: hidden; pointer-events: none; border-radius: inherit;
    -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 45%); mask-image: linear-gradient(90deg, transparent 0, #000 45%);
}
.fm-geo canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
@media (max-width: 700px) { .fm-geo { display: none; } }
.fm-ph__main { min-width: 0; }
.fm-ph__crumb { font-size: .75rem; font-weight: 600; color: #b9c6df; }
.fm-ph__crumb a { color: inherit; text-decoration: none; }
.fm-ph__crumb a:hover { color: #fff; }
.fm-ph__crumb b { color: #f0d68a; font-weight: 800; }
.fm-ph__title { margin: .15rem 0 0; color: #fff; font: 800 1.55rem var(--fm-font-head, 'Manrope', sans-serif); letter-spacing: -.035em; text-shadow: 0 4px 18px rgba(4, 10, 40, .4); }
.fm-ph__sub { margin: .2rem 0 0; font-size: .78rem; color: #cdd7ec; }
.fm-ph__actions { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: .55rem; }

/* controls placed on the banner */
.fm-ph .rz-button, .fm-ph .btn {
    border-radius: 12px; font-weight: 800; color: #fff; box-shadow: none;
    background: rgba(255, 255, 255, .12); border: 1px solid rgba(255, 255, 255, .25); backdrop-filter: blur(6px);
}
.fm-ph .rz-button:hover:not(.rz-state-disabled), .fm-ph .btn:hover { background: rgba(255, 255, 255, .22); color: #fff; transform: none; }
.fm-ph .rz-button.rz-primary, .fm-ph .btn-primary {
    color: #241a00; border-color: transparent; background: linear-gradient(135deg, #f3dc9a, #d3a942);
    box-shadow: 0 10px 22px rgba(227, 180, 66, .35);
}
.fm-ph .rz-button.rz-primary:hover:not(.rz-state-disabled), .fm-ph .btn-primary:hover { background: linear-gradient(135deg, #f7e3ab, #dcb24d); color: #241a00; }
.fm-ph .rz-button .rzi, .fm-ph .rz-button .rz-button-text { color: inherit; }
.fm-ph .rz-dropdown, .fm-ph .rz-textbox, .fm-ph .rz-datepicker, .fm-ph .rz-autocomplete, .fm-ph .form-select, .fm-ph .form-control {
    background: rgba(255, 255, 255, .96); color: var(--fm-ink, #16283b); border: 1px solid transparent; border-radius: 12px;
}
.fm-ph .rz-dropdown .rz-dropdown-label, .fm-ph .rz-dropdown .rz-placeholder { color: var(--fm-ink, #16283b); }
.fm-ph .fm-ph__actions .rz-dropdown {
    width: 250px !important;
    min-width: 250px;
    max-width: 250px;
    box-sizing: border-box;
}
.fm-ph .rz-dropdown .rz-dropdown-label {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    padding-right: 35px;
    box-sizing: border-box;
}
@media (max-width: 767.98px) {
    .fm-ph { margin: .5rem .5rem 1rem; padding: 1.1rem; border-radius: 16px; }
    .fm-ph__title { font-size: 1.25rem; }
    .fm-ph__actions { width: 100%; justify-content: flex-start; }
/*    .fm-ph .rz-dropdown { width: 100% !important; max-width: none; }*/
}

/* ---------- Stat cards (FmStat) ---------- */
.fm-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 1rem; margin-bottom: 1rem; }
.fm-stat {
    --sc: #c9a94f; --st: #fbf5e2;
    position: relative; overflow: hidden; display: flex; align-items: center; gap: .9rem; padding: 1.1rem 1.2rem;
    color: inherit; text-decoration: none; border: 1px solid #e6eaf2; border-radius: 18px;
    background: linear-gradient(160deg, #fff 55%, var(--st)); box-shadow: 0 1px 2px rgba(11, 20, 38, .05), 0 4px 14px rgba(11, 20, 38, .06);
    transition: transform .16s, box-shadow .16s, border-color .16s;
}
.fm-stat::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--sc); }
.fm-stat:hover { transform: translateY(-3px); box-shadow: 0 2px 4px rgba(11, 20, 38, .05), 0 18px 40px rgba(11, 20, 38, .14); border-color: var(--sc); color: inherit; }
.fm-stat__ic { width: 50px; height: 50px; border-radius: 15px; display: grid; place-items: center; font-size: 1.35rem; color: #fff; flex: none; box-shadow: 0 8px 18px rgba(11, 20, 38, .18); }
.fm-stat__val { font: 800 1.6rem/1.1 var(--fm-font-head, 'Manrope', sans-serif); color: #0b1426; font-variant-numeric: tabular-nums; }
.fm-stat__lbl { font-size: .76rem; font-weight: 700; color: #7d879d; margin-top: .15rem; }
.fm-stat--navy { --sc: #2a5fa3; --st: #e9f2fb; }
.fm-stat--navy .fm-stat__ic { background: linear-gradient(135deg, #5aa0dc, #2a5fa3); }
.fm-stat--green, .fm-stat--teal { --sc: #1d8a7c; --st: #e3f5f0; }
.fm-stat--green .fm-stat__ic, .fm-stat--teal .fm-stat__ic { background: linear-gradient(135deg, #4cc3a8, #1d8a7c); }
.fm-stat--orange { --sc: #d9741b; --st: #fdf0e2; }
.fm-stat--orange .fm-stat__ic { background: linear-gradient(135deg, #f8b64c, #d9741b); }
.fm-stat--gold { --sc: #c9a94f; --st: #fbf5e2; }
.fm-stat--gold .fm-stat__ic { background: linear-gradient(135deg, #e3cd94, #b8973f); color: #241a00; }
.fm-stat--red { --sc: #d2404d; --st: #fdeced; }
.fm-stat--red .fm-stat__ic { background: linear-gradient(135deg, #ef7a85, #d2404d); }

/* ---------- Avatar (FmAvatar) ---------- */
.fm-av {
    display: inline-grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; margin-right: .6rem; flex: none; vertical-align: middle;
    font: 800 .7rem var(--fm-font-head, 'Manrope', sans-serif); letter-spacing: .02em; color: #f3dc9a; background: #14213d;
}

/* ---------- Table card refinements to match the template ---------- */
.rz-datatable .rz-grid-table thead th,
.rz-datatable .rz-datatable-thead th { background: linear-gradient(#f8f6ee, #f1f3f9); color: #4a5570; border-bottom: 1px solid #e6eaf2; }
.rz-datatable .rz-grid-table td { font-size: .86rem; padding: .8rem 1rem; }
.rz-datatable .rz-grid-table tbody tr.rz-data-row:hover td { background: #fffaf0; }
.rz-card { background: #fffdf9; }
.rz-dialog, .modal-content { border-radius: 24px; box-shadow: 0 30px 70px rgba(11, 20, 38, .4); }

.fm-cell { display: inline-flex; align-items: center; }

/* ---------- Configurations: masters list + selected master (MastersLayout) ---------- */
.fm-masters { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 1rem; align-items: start; padding: 0 1rem 1.25rem; }
.fm-masters__nav {
    position: sticky; top: 80px; padding: .6rem; background: #fffdf9; border: 1px solid #e6eaf2; border-radius: 18px;
    box-shadow: 0 1px 2px rgba(11, 20, 38, .05), 0 4px 14px rgba(11, 20, 38, .06);
}
.fm-masters__cap { padding: .4rem .7rem .5rem; font-size: .68rem; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: #8697a8; }
.fm-masters__link {
    display: block; padding: .55rem .75rem; margin-bottom: 2px; border-radius: 10px; text-decoration: none;
    font-size: .84rem; font-weight: 700; color: #5c7186; transition: background .15s, color .15s;
}
.fm-masters__link:hover { background: #f3f5f9; color: #0b1426; }
.fm-masters__link.is-current { background: #f0eaf0; color: #685064; box-shadow: inset 3px 0 0 #d3a942; }
.fm-masters__body { min-width: 0; }
/* the master's own banner/table sit inside the right column */
.fm-masters__body .fm-ph { margin: 0 0 1.2rem; }
.fm-masters__body .p-2, .fm-masters__body .kanban-container > .p-2 { padding: 0 !important; }
@media (max-width: 991.98px) {
    .fm-masters { grid-template-columns: 1fr; padding: 0 .5rem 1rem; }
    .fm-masters__nav { position: static; display: flex; gap: .35rem; overflow-x: auto; padding: .5rem; }
    .fm-masters__cap { display: none; }
    .fm-masters__link { white-space: nowrap; margin: 0; }
}

/* ---------- Master card: title + actions above the table (Configurations page) ---------- */
.fm-mcard {
    background: #fffdf9; border: 1px solid #e6eaf2; border-radius: 20px; overflow: hidden;
    box-shadow: 0 1px 2px rgba(11, 20, 38, .05), 0 4px 14px rgba(11, 20, 38, .06);
}
.fm-mcard__head {
    position: relative; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .75rem;
    padding: 1.1rem 1.5rem; border-bottom: 1px solid #f0ece5;
}
.fm-mcard__head::before { content: ""; position: absolute; left: 0; top: 18%; bottom: 18%; width: 5px; border-radius: 0 6px 6px 0; background: linear-gradient(#e3cd94, #b8973f); }
.fm-mcard__title { font: 800 1.15rem var(--fm-font-head, 'Manrope', sans-serif); letter-spacing: -.02em; color: #0b1426; }
.fm-mcard__actions { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; }
.fm-mcard .rz-button.rz-primary { border-radius: 12px; }
.fm-mcard .rz-card, .fm-mcard .rz-datatable { border: 0 !important; box-shadow: none !important; border-radius: 0; }
.fm-mcard .p-2 { padding: 0 !important; }
.fm-masters__link { color: #4a5570; }
