/*
 * Admin landing (/sponsor/admin) — group launchpad for admins with 2+ sponsors.
 *
 * Shown to any ROLE_ADMIN that lands before picking a sponsor: system admins
 * and sponsor admins with more than one group. Styling is token-based
 * (theme-tokens.css + brand vars) so it reads correctly in both light and
 * dark themes — no hardcoded gray utilities.
 */

.admin-home {
    display: grid;
    gap: 34px;
}

/* ---- Header --------------------------------------------------------- */
.admin-home__header {
    display: grid;
    gap: 6px;
}

.admin-home__greeting {
    margin: 0;
    color: var(--text);
    font-size: clamp(24px, 3vw, 32px);
    font-weight: 850;
    line-height: 1.1;
    letter-spacing: -0.01em;
}

.admin-home__subtitle {
    margin: 0;
    color: var(--muted);
    font-size: 14px;
    font-weight: 650;
}

/* ---- Section -------------------------------------------------------- */
.admin-home__section {
    display: grid;
    gap: 16px;
}

.admin-home__section-head {
    display: grid;
    gap: 3px;
}

.admin-home__section-title {
    margin: 0;
    color: var(--text);
    font-size: 17px;
    font-weight: 800;
}

.admin-home__section-description {
    margin: 0;
    color: var(--muted);
    font-size: 13px;
    font-weight: 600;
}

/* ---- Card grid ------------------------------------------------------ */
.admin-home__grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 14px;
}

/* ---- Group card ----------------------------------------------------- */
.admin-home__card {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 16px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: var(--surface);
    color: var(--text);
    text-decoration: none;
    box-shadow: var(--shadow);
    transition: transform 160ms ease, border-color 160ms ease, box-shadow 160ms ease, background-color 160ms ease;
}

.admin-home__card:hover {
    transform: translateY(-2px);
    border-color: color-mix(in srgb, var(--color-primary) 55%, var(--line));
    box-shadow: 0 14px 30px rgba(0, 0, 0, 0.16);
}

.admin-home__card:focus-visible {
    outline: 3px solid var(--focus);
    outline-offset: 2px;
}

.admin-home__avatar {
    flex: 0 0 auto;
    display: grid;
    place-items: center;
    width: 44px;
    height: 44px;
    border-radius: 10px;
    background: color-mix(in srgb, var(--color-primary) 16%, transparent);
    color: var(--color-primary);
    font-size: 18px;
    font-weight: 850;
    text-transform: uppercase;
}

.admin-home__card-body {
    display: grid;
    gap: 4px;
    min-width: 0;
}

.admin-home__card-name {
    overflow: hidden;
    color: var(--text);
    font-size: 15px;
    font-weight: 800;
    line-height: 1.2;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.admin-home__card-meta {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
}

.admin-home__card-arrow {
    margin-left: auto;
    color: var(--muted);
    transition: transform 160ms ease, color 160ms ease;
}

.admin-home__card:hover .admin-home__card-arrow {
    transform: translateX(3px);
    color: var(--color-primary);
}

/* ---- Locked badge --------------------------------------------------- */
.admin-home__badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 8px;
    border-radius: 999px;
    background: color-mix(in srgb, var(--color-warning) 18%, transparent);
    color: color-mix(in srgb, var(--color-warning) 82%, var(--text));
    font-size: 11px;
    font-weight: 800;
}

/* ---- System tool card ----------------------------------------------- */
/* The body holds only the module name, so it must sit on the icon's centre
   line: with flex-start the label hugged the top of the 40px icon tile and
   read as misaligned — and inconsistent with the group cards above. */
.admin-home__tool {
    display: flex;
    align-items: center;
    gap: 13px;
    padding: 16px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: var(--surface);
    color: var(--text);
    text-decoration: none;
    transition: transform 160ms ease, border-color 160ms ease, background-color 160ms ease;
}

.admin-home__tool:hover {
    transform: translateY(-2px);
    border-color: color-mix(in srgb, var(--color-primary) 45%, var(--line));
    background: var(--surface-strong);
}

.admin-home__tool:focus-visible {
    outline: 3px solid var(--focus);
    outline-offset: 2px;
}

.admin-home__tool-icon {
    flex: 0 0 auto;
    display: grid;
    place-items: center;
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: color-mix(in srgb, var(--color-primary) 12%, transparent);
    color: var(--color-primary);
}

.admin-home__tool-body {
    display: grid;
    gap: 2px;
    min-width: 0;
}

.admin-home__tool-name {
    color: var(--text);
    font-size: 14px;
    font-weight: 800;
    line-height: 1.2;
}

/* ---- Empty state ---------------------------------------------------- */
.admin-home__empty {
    display: grid;
    justify-items: center;
    gap: 10px;
    padding: 44px 20px;
    border: 1px dashed var(--line-strong);
    border-radius: 12px;
    color: var(--muted);
    text-align: center;
}

/* On narrow screens the fixed topbar wraps to two lines (long tenant name),
   growing taller than the layout's fixed 80px top padding. Add a little
   clearance so the greeting is never tucked under the navbar. */
@media (max-width: 767px) {
    .admin-home {
        padding-top: 28px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .admin-home__card:hover,
    .admin-home__tool:hover {
        transform: none;
    }
}
