/*
    The management tables. They are dense on purpose: these pages are read by scanning down a
    column to compare rows, so the type is small, the rows are tight, and numbers are aligned on
    the right where the eye can compare them.
*/

.admin-title {
    font-size: 1.6rem;
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.admin-heading {
    font-size: 1.05rem;
    font-weight: 600;
    margin-top: 1.75rem;
    margin-bottom: 0.5rem;
}

.admin-heading-count {
    font-weight: 400;
    color: var(--bs-secondary-color);
    font-size: 0.85rem;
}

.admin-heading-note {
    font-weight: 400;
    color: var(--bs-secondary-color);
    font-size: 0.8rem;
    font-style: italic;
}

/* ---- navigation ---------------------------------------------------------------------------- */

.admin-nav {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    padding: 0.6rem 0.75rem;
    margin-bottom: 1.25rem;
    background: var(--bs-tertiary-bg);
    border: 1px solid var(--bs-border-color);
    border-radius: 0.375rem;
}

.admin-group {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 0.35rem;
}

.admin-group-label {
    width: 4.5rem;
    flex: none;
    color: var(--bs-secondary-color);
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.admin-tab {
    padding: 0.15rem 0.55rem;
    border-radius: 0.25rem;
    font-size: 0.85rem;
    color: var(--bs-body-color);
    text-decoration: none;
    border: 1px solid transparent;
}

.admin-tab:hover {
    background: var(--bs-secondary-bg);
    text-decoration: none;
}

.admin-tab.active {
    background: #2a5d94;
    border-color: #3a70ab;
    color: #fff;
}

/* ---- the hub ------------------------------------------------------------------------------- */

.admin-card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
    gap: 0.75rem;
}

.admin-card {
    display: block;
    padding: 0.7rem 0.85rem;
    border: 1px solid var(--bs-border-color);
    border-radius: 0.375rem;
    text-decoration: none;
    color: inherit;
    background: var(--bs-tertiary-bg);
}

.admin-card:hover {
    border-color: var(--bs-link-color);
    text-decoration: none;
}

.admin-card-title {
    display: inline-block;
    font-weight: 600;
    margin-right: 0.4rem;
}

.admin-card-count {
    color: var(--bs-secondary-color);
    font-variant-numeric: tabular-nums;
    font-size: 0.85rem;
}

.admin-card-blurb {
    display: block;
    margin-top: 0.2rem;
    color: var(--bs-secondary-color);
    font-size: 0.8rem;
    line-height: 1.3;
}

/* ---- tables -------------------------------------------------------------------------------- */

.admin-table {
    font-size: 0.82rem;
    white-space: nowrap;
}

.admin-table th {
    font-weight: 600;
    color: var(--bs-secondary-color);
    border-bottom-width: 1px;
    position: sticky;
    top: 0;
    background: var(--bs-body-bg);
    z-index: 1;
}

.admin-table td,
.admin-table th {
    padding: 0.25rem 0.5rem;
    vertical-align: top;
}

.admin-table .num {
    text-align: right;
    font-variant-numeric: tabular-nums;
}

.admin-table code {
    color: #c9a4ff;
    font-size: 0.78rem;
}

/* Prose columns -- descriptions, effect lists, contents -- are the ones allowed to wrap, and are
   held to a readable measure so one long description cannot push every other column off screen. */
.admin-table .admin-prose {
    white-space: normal;
    max-width: 34rem;
    min-width: 12rem;
}

/* ---- the filter ---------------------------------------------------------------------------- */

.admin-filter {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    margin-bottom: 0.4rem;
}

.admin-filter input {
    max-width: 22rem;
}

/* ---- sections, balances and sorting -------------------------------------------------------- */

.admin-subtitle {
    font-size: 1.05rem;
    margin: 1.5rem 0 0.5rem;
    color: var(--ooc-gold);
}

/* A chain's balance: short in one colour, spare in another, so the eye finds both down a column. */
.admin-table .admin-short { color: #ff9a8a; }
.admin-table .admin-spare { color: #9fdc9f; }

/* Headings of a sortable table sort it; the arrow says which way. */
.admin-sortable th {
    cursor: pointer;
    user-select: none;
}
.admin-sortable th[data-sorted="asc"]::after { content: " \25B2"; font-size: 0.7em; }
.admin-sortable th[data-sorted="desc"]::after { content: " \25BC"; font-size: 0.7em; }
