:host {
    display: block;
}

.admin-metric span,
.admin-definition-list dt {
    color: var(--p-text-muted-color);
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
}

.admin-metric,
.admin-health-tile {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    min-width: 0;
    padding: 0.85rem 0.95rem;
    border-right: 1px solid var(--p-content-border-color);
}

.admin-metric strong {
    color: var(--p-text-color);
    font-size: 1.35rem;
    font-weight: 750;
    line-height: 1.1;
}

.admin-metric span:last-child,
.admin-health-tile span,
.admin-panel__meta {
    color: var(--p-text-muted-color);
    font-size: 0.78rem;
    font-weight: 650;
}

.admin-status__panel-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
}

.admin-panel {
    min-width: 0;
    overflow: hidden;
    border: 1px solid var(--p-content-border-color);
    border-radius: 8px;
    background: var(--p-content-background);
}

.admin-panel__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1rem 1.05rem;
    border-bottom: 1px solid var(--p-content-border-color);
}

.admin-panel__title-block {
    display: grid;
    gap: 0.25rem;
    min-width: 0;
}

.admin-panel__header h2 {
    margin: 0;
    color: var(--p-text-color);
    font-size: 1rem;
    font-weight: 750;
    line-height: 1.25;
}

.admin-panel__content,
.admin-panel__messages {
    padding: 1rem 1.05rem;
}

.admin-panel__messages {
    display: grid;
    gap: 0.75rem;
    padding-bottom: 0;
}

.admin-health-grid,
.admin-metric-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    border-block: 1px solid var(--p-content-border-color);
}

.admin-health-tile:nth-child(4n),
.admin-metric:nth-child(4n) {
    border-right: 0;
}

.admin-definition-list {
    display: grid;
    gap: 0.75rem;
    margin: 0;
}

.admin-definition-list div {
    display: grid;
    grid-template-columns: minmax(8rem, 0.42fr) minmax(0, 1fr);
    align-items: center;
    gap: 1rem;
    min-width: 0;
    padding-bottom: 0.7rem;
    border-bottom: 1px solid var(--p-content-border-color);
}

.admin-definition-list div:last-child,
.admin-feature:last-child {
    padding-bottom: 0;
    border-bottom: 0;
}

.admin-definition-list dd {
    min-width: 0;
    margin: 0;
    color: var(--p-text-color);
    font-size: 0.9rem;
    font-weight: 600;
    overflow-wrap: anywhere;
}

.admin-mono {
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
    font-size: 0.8rem !important;
}

.admin-feature-list {
    display: grid;
    gap: 0.55rem;
}

.admin-feature {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    min-width: 0;
    padding: 0.65rem 0;
    border-bottom: 1px solid var(--p-content-border-color);
}

.admin-empty-cell {
    color: var(--p-text-muted-color);
    font-size: 0.88rem;
}

.admin-table-wrap {
    min-width: 0;
    overflow-x: auto;
}

.admin-empty-cell {
    padding: 1.5rem !important;
    text-align: center;
}

.admin-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.55rem;
    min-height: 7rem;
    color: var(--p-text-muted-color);
}

.admin-path-cell {
    max-width: 30rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.admin-search {
    width: min(100%, 18rem);
}

.admin-search input {
    width: 100%;
}

.admin-user-cell {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
    min-width: 12rem;
}

.admin-role-select {
    width: 11rem;
}

.admin-link {
    color: var(--p-primary-color);
    font-weight: 650;
    text-decoration: none;
}

.admin-mail-test {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: end;
    gap: 0.75rem;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--p-content-border-color);
}

.admin-mail-test__field {
    display: grid;
    gap: 0.35rem;
    min-width: 0;
}

.admin-mail-test__field label {
    color: var(--p-text-muted-color);
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: uppercase;
}

.admin-mail-test__field input {
    width: 100%;
}

.admin-mail-test__field small {
    color: var(--p-red-500);
    font-size: 0.78rem;
}

@media (max-width: 1180px) {
    .admin-status__panel-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 760px) {
    .admin-health-grid,
    .admin-metric-grid {
        grid-template-columns: 1fr;
    }

    .admin-health-tile,
    .admin-metric {
        border-right: 0;
        border-bottom: 1px solid var(--p-content-border-color);
    }

    .admin-health-tile:last-child,
    .admin-metric:last-child {
        border-bottom: 0;
    }

    .admin-panel__header {
        flex-direction: column;
        align-items: stretch;
        gap: 0.75rem;
    }

    .admin-definition-list div,
    .admin-mail-test {
        grid-template-columns: 1fr;
    }

    .admin-search,
    .admin-mail-test {
        width: 100%;
    }
}
