/*
 * Admin app only, loaded after leagueroots.css and scoped to body.lr-admin.
 *
 * The public site's look is white cards on a white page with a faint edge, which suits a
 * club's home page and leaves an administration screen as one undivided sheet: sections,
 * tables and forms ran into each other. Here sections sit on a grey page, carry a coloured
 * top edge and a tinted heading strip, and tables have a shaded header row.
 */

.lr-admin {
    --lr-admin-page: #eceff4;
    --lr-admin-edge: #cfd6e0;
    --lr-admin-strip: #e8eef7;
    --lr-admin-strip-edge: #d3dcea;
    --lr-admin-sunken: #f6f8fb;
    --lr-admin-field-edge: #868e9a; /* 3:1 against the white field (WCAG 1.4.11) */

    background-color: var(--lr-admin-page);
}

/* The page title, so where one page starts is never in doubt. */
.lr-admin main h1 {
    color: var(--lr-color-primary);
    font-weight: 700;
}

/* ---- Sections ---- */

.lr-admin .lr-card {
    border: 1px solid var(--lr-admin-edge);
    border-top: 3px solid var(--lr-color-primary);
    box-shadow: 0 1px 2px rgb(15 23 42 / 6%), 0 2px 6px rgb(15 23 42 / 6%);
}

/* A section that is just a table: clipped, so the shaded header row keeps the card's corners. */
.lr-admin .lr-card.p-0 {
    overflow: hidden;
}

/* A section's heading as a strip across its top. Most admin sections open with an h2, or with
   a row holding one and its buttons; both get the strip. The margin is forced because the
   pages put mb-0 on some of these headings, and the strip needs its own space below. */
.lr-admin .lr-card > h2:first-child,
.lr-admin .lr-card > .d-flex:first-child:has(> h2) {
    margin: -1.25rem -1.25rem 1rem !important;
    padding: 0.7rem 1.25rem;
    background: var(--lr-admin-strip);
    border-bottom: 1px solid var(--lr-admin-strip-edge);
    color: var(--lr-color-primary);
}

.lr-admin .lr-card > h2:first-child,
.lr-admin .lr-card > .d-flex:first-child > h2 {
    font-size: 1rem;
    font-weight: 650;
    color: var(--lr-color-primary);
}

/* A section within a section reads as a panel set into it, not another card on top. */
.lr-admin .lr-card .lr-card {
    background: var(--lr-admin-sunken);
    border: 1px solid var(--lr-admin-edge);
    border-left: 3px solid var(--lr-admin-field-edge);
    box-shadow: none;
}

.lr-admin .lr-card .lr-card > h2:first-child,
.lr-admin .lr-card .lr-card > .d-flex:first-child:has(> h2) {
    background: transparent;
}

.lr-admin hr {
    border-color: var(--lr-admin-edge);
    opacity: 1;
}

/* ---- Tables ---- */

.lr-admin .table > thead th {
    background: var(--lr-admin-strip);
    border-bottom: 2px solid var(--lr-admin-strip-edge);
    color: #334155;
    font-size: 0.8rem;
    font-weight: 650;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    white-space: nowrap;
}

.lr-admin .table > tbody > tr:hover > * {
    background-color: #f3f6fb;
}

.lr-admin .table > :not(caption) > * > * {
    border-bottom-color: #e2e7ee;
}

/* ---- Forms ---- */

/* Fields visible as fields: on white, Bootstrap's pale grey edge all but disappears. */
/* Not on an invalid field, whose red edge is how the error shows. */
.lr-admin .form-control:not(.is-invalid),
.lr-admin .form-select:not(.is-invalid),
.lr-admin .form-check-input:not(.is-invalid, :checked) {
    border-color: var(--lr-admin-field-edge);
}

.lr-admin .form-label {
    font-weight: 500;
}

.lr-admin fieldset {
    padding: 0.75rem 1rem;
    border: 1px solid var(--lr-admin-edge);
    border-radius: var(--lr-radius);
    background: var(--lr-admin-sunken);
}

.lr-admin legend {
    float: none;
    width: auto;
    padding: 0 0.35rem;
    margin-bottom: 0.25rem;
    font-size: 0.95rem;
    font-weight: 600;
}

/* ---- Footer ---- */

.lr-admin .lr-admin-footer {
    background: transparent;
    border-top-color: var(--lr-admin-edge);
}
