:root {
    color-scheme: dark;
    --cfmp-page: #101010;
    --cfmp-surface: #1e1e1e;
    --cfmp-raised: #292929;
    --cfmp-field: #303030;
    --cfmp-border: #424242;
    --cfmp-field-border: #6d6773;
    --cfmp-text: #f5f5f5;
    --cfmp-muted: #c6c3ca;
    --cfmp-link: #d8baff;
    --cfmp-accent: #6c3cb3;
    --cfmp-accent-border: #9662da;
    --cfmp-accent-soft: #382651;
    --cfmp-title-tint: #38234f;
    font: 16px/1.5 system-ui, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
.cfmp { min-height: 100vh; margin: 0; background: var(--cfmp-page); color: var(--cfmp-text); }
.cfmp h1, .cfmp h2, .cfmp p { margin: 0; }
.cfmp h1 { font-size: clamp(1.6rem, 3vw, 2.25rem); letter-spacing: -.04em; line-height: 1.18; }
.cfmp h2 { margin-bottom: 9px; font-size: 1.25rem; letter-spacing: -.02em; }
.cfmp p { margin-top: .45rem; color: var(--cfmp-muted); }
.cfmp small { color: var(--cfmp-muted); overflow-wrap: anywhere; }
.cfmp a { color: var(--cfmp-link); }
.cfmp :focus-visible { outline: 2px solid var(--cfmp-link); outline-offset: 3px; }
.cfmp svg { flex: none; }

.cfmp-shell {
    display: grid;
    grid-template-columns: 240px minmax(0, 1fr);
    gap: 18px;
    max-width: 1600px;
    margin: auto;
    padding: 18px;
}

.cfmp-sidebar {
    display: flex;
    position: sticky;
    top: 18px;
    align-self: start;
    flex-direction: column;
    gap: 18px;
    min-height: calc(100dvh - 36px);
    padding: 20px 15px;
    border-radius: 19px;
    background: var(--cfmp-surface);
}

.cfmp-brand {
    display: block;
    align-self: center;
    width: min(100%, 210px);
}
.cfmp-brand img {
    display: block;
    width: 100%;
    height: auto;
}
.cfmp-auth-shell {
    width: min(100% - 36px, 450px);
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 22px;
    margin-inline: auto;
    padding-block: 24px;
}
.cfmp-auth-shell .cfmp-brand { width: min(72%, 240px); align-self: center; }
.cfmp:has(.cfmp-auth-shell) {
    background: radial-gradient(ellipse at 50% 12%, var(--cfmp-title-tint), transparent 53%), var(--cfmp-page);
}
.cfmp-auth-shell h1 { margin-bottom: 16px; }
.cfmp-account { display: grid; gap: 2px; padding: 10px; border-block: 1px solid var(--cfmp-border); }
.cfmp-nav { display: grid; gap: 5px; }
.cfmp-nav a {
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 10px;
    border-radius: 8px;
    color: var(--cfmp-text);
    font-weight: 650;
    text-decoration: none;
}
.cfmp-nav a:hover { background: var(--cfmp-raised); }
.cfmp-nav a[aria-current="page"] { background: var(--cfmp-accent-soft); color: var(--cfmp-link); }
.cfmp-signout { margin-top: auto; }
.cfmp main { min-width: 0; }
.cfmp-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
    min-height: 100px;
    margin-bottom: 18px;
    padding: 18px 22px;
    background: linear-gradient(to right, var(--cfmp-title-tint), var(--cfmp-page));
}
.cfmp-header > div { min-width: 0; overflow-wrap: anywhere; }
.cfmp-back { display: inline-block; margin-bottom: 7px; font-size: .87rem; font-weight: 650; text-decoration: none; }
.cfmp-back:hover { text-decoration: underline; }

.cfmp-card {
    min-width: 0;
    padding: clamp(15px, 3vw, 24px);
    border: 1px solid var(--cfmp-border);
    border-radius: 15px;
    background: var(--cfmp-surface);
    box-shadow: 0 8px 24px #0002;
}
.cfmp-columns { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: start; gap: 16px; }
.cfmp-stack { display: grid; gap: 16px; min-width: 0; }
.cfmp-section-title, .cfmp-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 14px; }
.cfmp-section-title { justify-content: space-between; margin-bottom: 10px; }
.cfmp-section-title h2 { margin: 0; }
.cfmp-form { display: grid; gap: 12px; margin: 12px 0 0; }
.cfmp-form > button { justify-self: start; }
.cfmp-search { display: flex; align-items: end; flex-wrap: wrap; gap: 10px; margin: 12px 0; }
.cfmp-search > label { flex: 1 1 14rem; min-width: 0; max-width: 28rem; }
.cfmp-fields { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(185px, 100%), 1fr)); gap: 12px; }
.cfmp label { display: grid; gap: 5px; color: var(--cfmp-text); font-size: .9rem; font-weight: 650; }
.cfmp-fields > label { grid-template-rows: 1fr auto; }
.cfmp input, .cfmp select {
    width: 100%;
    min-width: 0;
    height: 44px;
    padding: 9px 11px;
    border: 1px solid var(--cfmp-field-border);
    border-radius: 9px;
    background: var(--cfmp-field);
    color: var(--cfmp-text);
    font: inherit;
}
.cfmp .cfmp-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 44px;
    padding: 8px 13px;
    border: 1px solid var(--cfmp-accent-border);
    border-radius: 9px;
    background: var(--cfmp-accent);
    color: #fff;
    font: 650 .9rem system-ui, sans-serif;
    text-decoration: none;
    cursor: pointer;
}
.cfmp-button:hover { filter: brightness(1.14); }
.cfmp .cfmp-secondary { border-color: var(--cfmp-border); background: var(--cfmp-raised); }
.cfmp .cfmp-danger { border-color: #bc535d; background: #8a303c; }
.cfmp details { margin-top: 12px; }
.cfmp summary { width: fit-content; color: var(--cfmp-link); font-weight: 650; cursor: pointer; }

.cfmp-records { display: grid; gap: 9px; margin: 12px 0 0; padding: 0; list-style: none; }
.cfmp-records:empty { display: none; }
.cfmp .cfmp-record {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 8px 14px;
    padding: 12px;
    border: 1px solid var(--cfmp-border);
    border-radius: 10px;
    background: var(--cfmp-raised);
    color: var(--cfmp-text);
    text-decoration: none;
}
.cfmp a.cfmp-record:hover { border-color: var(--cfmp-link); }
.cfmp-record-primary { display: grid; gap: 2px; min-width: 0; overflow-wrap: anywhere; }
.cfmp-audit small { overflow-wrap: anywhere; }
.cfmp-pagination { display: flex; align-items: center; flex-wrap: wrap; gap: 15px; margin-top: 14px; color: var(--cfmp-muted); font-size: .9rem; }
.cfmp-facts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; margin: 12px 0; }
.cfmp-id { grid-column: 1 / -1; }
.cfmp dt { color: var(--cfmp-muted); font-size: .84rem; }
.cfmp dd { margin: 2px 0 0; font-weight: 650; overflow-wrap: anywhere; }
.cfmp-code { font: .78rem/1.5 ui-monospace, SFMono-Regular, Consolas, monospace; }
.cfmp-badge {
    padding: 4px 8px;
    border-radius: 7px;
    background: var(--cfmp-accent-soft);
    color: var(--cfmp-link);
    font-size: .84rem;
    font-weight: 650;
}
.cfmp-active { background: #233d2d; color: #a9e7bf; }
.cfmp-warning { background: #4b3523; color: #ffd1a3; }
.cfmp .cfmp-notice { margin: 0 0 12px; padding: 10px 13px; border: 1px solid var(--cfmp-border); border-radius: 8px; background: var(--cfmp-raised); color: var(--cfmp-text); }
.cfmp .cfmp-error { border-color: #a95e5e; background: #3d2326; color: #ffb8b8; }

@media (max-width: 1140px) {
    .cfmp-columns { grid-template-columns: 1fr; }
}
@media (max-width: 750px) {
    .cfmp-shell { grid-template-columns: minmax(0, 1fr); gap: 12px; padding: 10px; }
    .cfmp-sidebar { position: static; gap: 10px; min-height: auto; padding: 12px; }
    .cfmp-brand { align-self: start; width: 145px; }
    .cfmp-nav { display: flex; flex-wrap: wrap; }
    .cfmp-nav a { padding: 8px; font-size: .9rem; }
    .cfmp-header { padding: 14px; margin-bottom: 12px; }
    .cfmp-signout { margin: 0; }
}
@media (max-width: 380px) {
    .cfmp-facts { grid-template-columns: 1fr; }
}
